[FFmpeg-cvslog] avconv: set packet duration for CFR video streams

Anton Khirnov git at videolan.org
Tue Nov 10 18:38:27 CET 2015


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sun Oct 11 12:07:08 2015 +0200| [3efd71b4d0b4a73ccbbbdc092e6bbd54d92633f4] | committer: Anton Khirnov

avconv: set packet duration for CFR video streams

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

 avconv.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/avconv.c b/avconv.c
index 493f9d2..7334851 100644
--- a/avconv.c
+++ b/avconv.c
@@ -279,6 +279,11 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
         uint8_t *sd = av_packet_get_side_data(pkt, AV_PKT_DATA_QUALITY_FACTOR,
                                               NULL);
         ost->quality = sd ? *(int *)sd : -1;
+
+        if (ost->frame_rate.num) {
+            pkt->duration = av_rescale_q(1, av_inv_q(ost->frame_rate),
+                                         ost->st->time_base);
+        }
     }
 
     while (bsfc) {



More information about the ffmpeg-cvslog mailing list