diff options
author | Stefano Sabatini | 2007-05-30 14:20:55 +0000 |
---|---|---|
committer | Benoit Fouet | 2007-05-30 14:20:55 +0000 |
commit | c3b95b1d3d506da97faa83b5a866ca605cb57316 (patch) | |
tree | 7d136740f20f4c2bb51001d73b5c53a82aff50c1 /ffmpeg.c | |
parent | 808d83fd33c2c58d66f086fca689b9d6d46c5f2f (diff) |
Add support for listing the supported pixel formats using the option
-pix_fmt list
patch by Stefano Sabatini stefano sabatini minus lala chez poste it
original thread: [FFmpeg-devel] [PATCH] List supported pixel formats
date: 05/25/2007 05:46 PM
Originally committed as revision 9162 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffmpeg.c')
-rw-r--r-- | ffmpeg.c | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -2243,10 +2243,24 @@ static void opt_frame_pad_right(const char *arg) } } +void list_pix_fmts(void) +{ + int i; + char pix_fmt_str[128]; + for (i=-1; i < PIX_FMT_NB; i++) { + avcodec_pix_fmt_string (pix_fmt_str, sizeof(pix_fmt_str), i); + fprintf(stdout, "%s\n", pix_fmt_str); + } +} static void opt_frame_pix_fmt(const char *arg) { - frame_pix_fmt = avcodec_get_pix_fmt(arg); + if (strcmp(arg, "list")) + frame_pix_fmt = avcodec_get_pix_fmt(arg); + else { + list_pix_fmts(); + exit(0); + } } static void opt_frame_aspect_ratio(const char *arg) @@ -3596,7 +3610,7 @@ const OptionDef options[] = { { "r", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_rate}, "set frame rate (Hz value, fraction or abbreviation)", "rate" }, { "s", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_size}, "set frame size (WxH or abbreviation)", "size" }, { "aspect", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_aspect_ratio}, "set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)", "aspect" }, - { "pix_fmt", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_frame_pix_fmt}, "set pixel format", "format" }, + { "pix_fmt", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_frame_pix_fmt}, "set pixel format, 'list' as argument shows all the pixel formats supported", "format" }, { "croptop", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_crop_top}, "set top crop band size (in pixels)", "size" }, { "cropbottom", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_crop_bottom}, "set bottom crop band size (in pixels)", "size" }, { "cropleft", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_crop_left}, "set left crop band size (in pixels)", "size" }, |