[FFmpeg-devel] [RFC] set up targets for xdcam

Dave Rice dave at dericed.com
Wed Jun 11 19:22:20 CEST 2014


Hi,
I was going to work on setting up targets for xdcam and imx formats. Since there are so many possibilities, particularly for xdcam, I was considering making one target per fourcc. Any comments on this approach before I continue?

diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index 887752d..ab9aae0 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -2275,6 +2275,34 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
         parse_option(o, "ar", "48000", options);
         parse_option(o, "ac", "2", options);
 
+    } else if (!strncmp(arg, "xd5b")) {
+
+        opt_video_codec(o, "c:v", "mpeg2video");
+        parse_option(o, "q:v", "1", options);
+        parse_option(o, "dc", "10", options);
+        parse_option(o, "s", "1920x1080", options);
+        parse_option(o, "b:v", "50M", options);
+        parse_option(o, "tag:v", "xd5b", options);
+        parse_option(o, "pix_fmt", "yuv422p", options);
+        parse_option(o, "r", "ntsc", options);
+        parse_option(o, "aspect", "16/9", options);
+        av_dict_set(&o->g->codec_opts, "intra_vlc", "1", AV_DICT_DONT_OVERWRITE);
+        av_dict_set(&o->g->codec_opts, "non_linear_quant", "1", AV_DICT_DONT_OVERWRITE);
+        av_dict_set(&o->g->codec_opts, "qmin", "1", AV_DICT_DONT_OVERWRITE);
+        av_dict_set(&o->g->codec_opts, "qmax", "8", AV_DICT_DONT_OVERWRITE);
+        av_dict_set(&o->g->codec_opts, "g", "15", AV_DICT_DONT_OVERWRITE);
+        av_dict_set(&o->g->codec_opts, "maxrate:v", "50M", AV_DICT_DONT_OVERWRITE);
+        av_dict_set(&o->g->codec_opts, "minrate:v", "50M", AV_DICT_DONT_OVERWRITE);
+        av_dict_set(&o->g->codec_opts, "bufsize", "17825792", AV_DICT_DONT_OVERWRITE);
+        av_dict_set(&o->g->codec_opts, "rc_init_occupancy", "17825792", AV_DICT_DONT_OVERWRITE);
+        av_dict_set(&o->g->codec_opts, "lmin", "QP2LAMBDA", AV_DICT_DONT_OVERWRITE);
+        av_dict_set(&o->g->codec_opts, "flags", "+ildct+ilme+low_delay", AV_DICT_DONT_OVERWRITE);
+        av_dict_set(&o->g->codec_opts, "ps", "1", AV_DICT_DONT_OVERWRITE);
+
+        opt_audio_codec(o, "c:a", "pcm_s24be");
+        parse_option(o, "ar", "48k", options);
+        parse_option(o, "ac", "2", options);
+
     } else {
         av_log(NULL, AV_LOG_ERROR, "Unknown target: %s\n", arg);
         return AVERROR(EINVAL);

Dave Rice


More information about the ffmpeg-devel mailing list