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.
This commit is contained in:

committed by
Clément Bœsch

parent
0f0f3bd1e0
commit
6b35f1a2a6
11
ffmpeg.c
11
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},
|
||||
|
Reference in New Issue
Block a user