26 #include "libavutil/pixdesc.h"
27 #include "libavcodec/avcodec.h"
28 #include "libavutil/common.h"
40 printf(
"Show the relationships between rawvideo pixel formats and FourCC tags.\n");
41 printf(
"usage: fourcc2pixfmt [OPTIONS]\n");
44 "-l list the pixel format for each fourcc\n"
45 "-L list the fourccs for each pixel format\n"
46 "-p PIX_FMT given a pixel format, print the list of associated fourccs (one per line)\n"
47 "-h print this help\n");
58 printf(
"%s%c", buf, sep);
63 int main(
int argc,
char **argv)
65 int i, list_fourcc_pix_fmt = 0, list_pix_fmt_fourccs = 0;
66 const char *pix_fmt_name = NULL;
74 while ((c =
getopt(argc, argv,
"hp:lL")) != -1) {
80 list_fourcc_pix_fmt = 1;
83 list_pix_fmt_fourccs = 1;
94 if (list_fourcc_pix_fmt) {
102 if (list_pix_fmt_fourccs) {
107 printf(
"%s: ", pix_desc->
name);
116 fprintf(stderr,
"Invalid pixel format selected '%s'\n", pix_fmt_name);
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag)
Put a string representing the codec tag codec_tag in buf.
enum AVPixelFormat av_get_pix_fmt(const char *name)
Return the pixel format corresponding to name.
const PixelFormatTag ff_raw_pix_fmt_tags[]
enum AVPixelFormat pix_fmt
AVPixelFormat
Pixel format.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
#define AV_PIX_FMT_FLAG_HWACCEL
Pixel format is an HW accelerated format.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
static int getopt(int argc, char *argv[], char *opts)
number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of...
static void print_pix_fmt_fourccs(enum AVPixelFormat pix_fmt, char sep)
int main(int argc, char **argv)