[FFmpeg-cvslog] examples/muxing: fix video pts

Michael Niedermayer git at videolan.org
Wed Oct 17 02:45:13 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Oct 17 02:32:43 2012 +0200| [7b8fd298161dac65d8ee0f8367f4048c9abaa053] | committer: Michael Niedermayer

examples/muxing: fix video pts

Fixes Ticket1801
Based on suggestion from AztecC
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 doc/examples/muxing.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/doc/examples/muxing.c b/doc/examples/muxing.c
index 56790ec..c0b0ec7 100644
--- a/doc/examples/muxing.c
+++ b/doc/examples/muxing.c
@@ -382,9 +382,6 @@ static void write_video_frame(AVFormatContext *oc, AVStream *st)
 
         /* If size is zero, it means the image was buffered. */
         if (got_output) {
-            if (c->coded_frame->pts != AV_NOPTS_VALUE)
-                pkt.pts = av_rescale_q(c->coded_frame->pts,
-                                       c->time_base, st->time_base);
             if (c->coded_frame->key_frame)
                 pkt.flags |= AV_PKT_FLAG_KEY;
 
@@ -509,7 +506,7 @@ int main(int argc, char **argv)
             write_audio_frame(oc, audio_st);
         } else {
             write_video_frame(oc, video_st);
-            frame->pts++;
+            frame->pts += av_rescale_q(1, video_st->codec->time_base, video_st->time_base);
         }
     }
 



More information about the ffmpeg-cvslog mailing list