[FFmpeg-devel] Patch for "non monotone timestamp" error

Diep Ho DHo
Thu Jul 31 18:06:00 CEST 2008


Hello,

I'm new. I made the following test of ffmpeg and got the "non monotone
timestamps".


========================================================================
======
ffmpeg -i test.MPG  -acodec copy -vcodec copy -b 600k -y Y.mpg | & more
------------------------------------------------------------------------
--
FFmpeg version SVN-r12230, Copyright (c) 2000-2008 Fabrice Bellard, et
al.
  configuration: --enable-libmp3lame --enable-pp --enable-gpl
--enable-x11grab
  libavutil version: 49.6.0
  libavcodec version: 51.50.1
  libavformat version: 52.7.0
  libavdevice version: 52.0.0
  built on Feb 26 2008 15:46:55, gcc: 4.1.2 20061115 (prerelease)
(Debian 4.1.1-21)
Input #0, mpeg, from 'test.MPG':
  Duration: 00:14:59.9, start: 38312.031289, bitrate: 635 kb/s
    Stream #0.0[0x1e0]: Video: mpeg1video, yuv420p, 352x288 [PAR 1:1 DAR
11:9], 104857 kb/s, 25.00 tb(r)
    Stream #0.1[0x1c0]: Audio: mp2, 48000 Hz, mono, 32 kb/s
Output #0, mpeg, to 'Y.mpg':
    Stream #0.0: Video: mpeg1video, yuv420p, 352x288 [PAR 0:1 DAR 0:1],
q=2-31, 104857 kb/s, 25.00 tb(c)
    Stream #0.1: Audio: mp2, 48000 Hz, mono, 32 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
Press [q] to stop encoding
error, non monotone timestamps 21600 >= 21600
av_interleaved_write_frame(): Error while opening file
========================================================================
=======



After taking a long look inside the ffmpeg codes, I found a weird line
and proposes the following patch. I think that is a wrong test for
b-frames. 



Index: libavformat/utils.c
===================================================================
--- libavformat/utils.c	(revision 14487)
+++ libavformat/utils.c	(working copy)
@@ -792,7 +792,7 @@
     /* XXX: need has_b_frame, but cannot get it if the codec is
         not initialized */
     if (delay &&
-        pc && pc->pict_type != FF_B_TYPE)
+        pc && pc->pict_type == FF_B_TYPE)
         presentation_delayed = 1;
     /* This may be redundant, but it should not hurt. */
     if(pkt->dts != AV_NOPTS_VALUE && pkt->pts != AV_NOPTS_VALUE &&
pkt->pts > pkt->dts)


Best regards,

Ngoc-Diep Ho
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bframes_test.patch
Type: application/octet-stream
Size: 574 bytes
Desc: bframes_test.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080731/b882fb1d/attachment.obj>



More information about the ffmpeg-devel mailing list