summaryrefslogtreecommitdiff
path: root/fftools/ffmpeg_demux.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_demux.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_demux.c')
-rw-r--r--fftools/ffmpeg_demux.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c
index d15cee614d..01fd19f199 100644
--- a/fftools/ffmpeg_demux.c
+++ b/fftools/ffmpeg_demux.c
@@ -176,6 +176,8 @@ static void *input_thread(void *arg)
}
}
+ pkt->opaque = (void*)av_gettime_relative();
+
msg.pkt = av_packet_alloc();
if (!msg.pkt) {
av_packet_unref(pkt);