From 6b35f1a2a6432cb79f657ea3fadb86b8e12dddcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= Date: Wed, 30 May 2012 10:26:53 +0200 Subject: timecode: move timecode muxer options to metadata. Some demuxers set a timecode in the format or streams metadata. The muxers now make use of this metadata instead of a duplicated private option. This makes possible transparent copy of the timecode when transmuxing and transcoding. -timecode option for MPEG1/2 codec is also renamed to -gop_timecode. The global ffmpeg -timecode option will set it anyway so no option change visible for the user. --- ffmpeg.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'ffmpeg.c') diff --git a/ffmpeg.c b/ffmpeg.c index 24b54edfb9..ccbddd435c 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -5618,6 +5618,16 @@ static int opt_deinterlace(const char *opt, const char *arg) return 0; } +static int opt_timecode(OptionsContext *o, const char *opt, const char *arg) +{ + char *tcr = av_asprintf("timecode=%s", arg); + int ret = parse_option(o, "metadata:g", tcr, options); + if (ret >= 0) + ret = opt_default("gop_timecode", arg); + av_free(tcr); + return ret; +} + static void parse_cpuflags(int argc, char **argv, const OptionDef *options) { int idx = locate_option(argc, argv, options, "cpuflags"); @@ -5752,6 +5762,7 @@ static const OptionDef options[] = { { "sameq", OPT_BOOL | OPT_VIDEO, {(void*)&same_quant}, "use same quantizer as source (implies VBR)" }, { "same_quant", OPT_BOOL | OPT_VIDEO, {(void*)&same_quant}, "use same quantizer as source (implies VBR)" }, + { "timecode", HAS_ARG | OPT_VIDEO | OPT_FUNC2, {(void*)opt_timecode}, "set initial TimeCode value.", "hh:mm:ss[:;.]ff" }, { "pass", HAS_ARG | OPT_VIDEO, {(void*)opt_pass}, "select the pass number (1 or 2)", "n" }, { "passlogfile", HAS_ARG | OPT_VIDEO, {(void*)&opt_passlogfile}, "select two pass log file name prefix", "prefix" }, { "deinterlace", OPT_EXPERT | OPT_VIDEO, {(void*)opt_deinterlace}, -- cgit v1.2.3