[FFmpeg-cvslog] avformat/flvenc: copyts in FLV muxer

Ivan git at videolan.org
Tue Jan 26 22:09:51 CET 2016


ffmpeg | branch: master | Ivan <grigoriev.ivan.a at gmail.com> | Mon Jan 25 14:43:40 2016 +0200| [a0174f67298ba9494c146183dd360e637b03db64] | committer: Michael Niedermayer

avformat/flvenc: copyts in FLV muxer

The purpose of this patch is to preserve timestamps when using ffmpeg for publishing RTMP streams, e.g. ffmpeg -i rtmp://source/stream -f flv rtmp://target/stream.
There is a setting "copyts" for that purpose. Unfortunately it doesn't work with FLV muxer because it has its own timestamp correction which makes global setting "copyts" ineffective.

This patch removes timestamp correction in FLV muxer. This means FLV will rely on ffmpeg timestamp correction which makes it possible to use copyts.

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a0174f67298ba9494c146183dd360e637b03db64
---

 libavformat/flvenc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index 3925768..8fd5d29 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -562,7 +562,7 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
         return AVERROR(EINVAL);
     }
 
-    ts = pkt->dts + flv->delay; // add delay to force positive dts
+    ts = pkt->dts;
 
     if (s->event_flags & AVSTREAM_EVENT_FLAG_METADATA_UPDATED) {
         write_metadata(s, ts);



More information about the ffmpeg-cvslog mailing list