summaryrefslogtreecommitdiff
path: root/fftools/ffmpeg_opt.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2022-08-09 14:25:55 +0200
committerAnton Khirnov <anton@khirnov.net>2022-08-10 11:47:29 +0200
commit65001aa93e8393c31c417b45761a318bc8cdd6ef (patch)
tree4b283b1f7b76eb79394541d5154e914474ea3108 /fftools/ffmpeg_opt.c
parentd931554f668186729bf290ed9afa6e9a4417328b (diff)
fftools/ffmpeg: add a live mux modelive
Track the wallclock time at which each input packet is demuxed and propagate it through decoding and encoding. When the live mux option is used, drop all packets demuxed before the muxer is opened. This is intended to avoid latency when opening the muxer takes a long time.
Diffstat (limited to 'fftools/ffmpeg_opt.c')
-rw-r--r--fftools/ffmpeg_opt.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index 97f14b2a5b..151b3bad07 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -2892,6 +2892,7 @@ static int open_output_file(OptionsContext *o, const char *filename)
of->recording_time = o->recording_time;
of->start_time = o->start_time;
of->shortest = o->shortest;
+ of->live = o->live;
av_dict_copy(&format_opts, o->g->format_opts, 0);
if (!strcmp(filename, "-"))
@@ -3969,6 +3970,7 @@ const OptionDef options[] = {
{ "bits_per_raw_sample", OPT_INT | HAS_ARG | OPT_EXPERT | OPT_SPEC | OPT_OUTPUT,
{ .off = OFFSET(bits_per_raw_sample) },
"set the number of bits per raw sample", "number" },
+ { "live", OPT_BOOL | OPT_OUTPUT | OPT_OFFSET, { .off = OFFSET(live) }, "live output" },
/* video options */
{ "vframes", OPT_VIDEO | HAS_ARG | OPT_PERFILE | OPT_OUTPUT, { .func_arg = opt_video_frames },