[FFmpeg-devel] Evaluation of flag AVFMT_TS_DISCONT

Michael Niedermayer michaelni
Fri Dec 17 13:25:03 CET 2010

On Fri, Dec 17, 2010 at 10:28:27AM +0100, Philip Spitzlinger wrote:
> Hello everybody,
> I am encounting problems when copying packets from MPEG2 Streams to a  
> new MPEG2 stream using the function av_interleaved_write_packet(...)
> It complains about "non monotone timestamps" as the previous packet and  
> the packet to be written have the same timestamp as read from the source  
> stream.
> This is even due to the fact that the output format has the flag  
> AVFMT_TS_DISCONT set, which as documented in avformat.h explicitly  
> allows non monotone timestamps.
> Unfortunately this flag is not evaluated in the  
> av_interleaved_write_packet() function, which gives me the error 
> described.
> Wouldn't it be more correct to evaluate this flag at this time and allow  
> the non monotone timestamp if the flag is set?
> Is there a certain reason why this flag is simply ignored at this time?

muxing needs valid timestamps, its needed for various buffering things and
for decissions on when to sent and repeat various packets for
Thus demuxer -> muxer always requires dicontinuities to be removed. One
could then store the actual packets with the discontinuous timestamps
but thats currently unsupported, iam also not sure what it would be good
for. Do you know of some use case that requires specific discontinuous ts?


Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101217/73cf7030/attachment.pgp>

More information about the ffmpeg-devel mailing list