Page 1 of 1

Failure to play MPEG2-TS from ffmpeg

Posted: 15 Mar 2010 23:07
by ykori
I am using ffmpeg with the -muxrate enabled to stream a MPEG2-TS (H264+AAC) file to VLC and VLC fails to play the stream It dumps a bunch of errors on the messages screen. muxrate with a CBR produces the stream with a lot of null packets. Does VLC not handle the nullpackets?

Thanks in advance.

The following are the messages:
avcodec error: more than 5 seconds of late video -> dropping frame (computer too slow ?)
main warning: PTS is out of range (1636737), dropping buffer
main warning: PTS is out of range (1613526), dropping buffer
main warning: PTS is out of range (1591304), dropping buffer
...
...
main warning: PTS is out of range (1568082), dropping buffer
main warning: PTS is out of range (1545860), dropping buffer
main warning: PTS is out of range (1522637), dropping buffer
main warning: PTS is out of range (1501426), dropping buffer
main warning: PTS is out of range (1634204), dropping buffer
main warning: PTS is out of range (1930843), dropping buffer
avcodec error: more than 5 seconds of late video -> dropping frame (computer too slow ?)
main warning: PTS is out of range (1908621), dropping buffer
main warning: PTS is out of range (1885410), dropping buffer
main warning: PTS is out of range (1863188), dropping buffer
main warning: PTS is out of range (1839965), dropping buffer
main warning: PTS is out of range (1817743), dropping buffer
...
main warning: PTS is out of range (1864833), dropping buffer
main warning: PTS is out of range (1846610), dropping buffer
main warning: late picture skipped (1893144 > 0)
main warning: PTS is out of range (2002828), dropping buffer
main warning: PTS is out of range (1979606), dropping buffer
main warning: PTS is out of range (1957395), dropping buffer
main warning: PTS is out of range (1934173), dropping buffer
main warning: PTS is out of range (1911950), dropping buffer
main warning: PTS is out of range (1888728), dropping buffer
main warning: late picture skipped (2042251 > 0)
main warning: PTS is out of range (1867506), dropping buffer
main warning: late picture skipped (2049250 > 0)
main warning: late picture skipped (2015917 > 0)
main warning: late picture skipped (2015917 > 0)
main warning: PTS is out of range (1991295), dropping buffer
main warning: PTS is out of range (1969073), dropping buffer
main warning: PTS is out of range (1945850), dropping buffer
main warning: PTS is out of range (1923628), dropping buffer
...

Re: Failure to play MPEG2-TS from ffmpeg

Posted: 17 Mar 2010 21:33
by ykori
I Have now found the real cause of the problem. It is not the null packets, but the packets that contain just PCR data. In the new ffmpeg, if you enable the muxrate option, it introduces null packets or PCR only packets to make the constant bit rate. these PCR only TS packets are causing the above problems with the VLC, do anyone know why?
I changed to ffmpeg to not send these and now my playback is smooth without any errors.

Re: Failure to play MPEG2-TS from ffmpeg

Posted: 15 Nov 2010 07:17
by kaps
I Have now found the real cause of the problem. It is not the null packets, but the packets that contain just PCR data. In the new ffmpeg, if you enable the muxrate option, it introduces null packets or PCR only packets to make the constant bit rate. these PCR only TS packets are causing the above problems with the VLC, do anyone know why?
I changed to ffmpeg to not send these and now my playback is smooth without any errors.
Can you please put somewhere a snippet to your code changes in ffmpeg ?

Re: Failure to play MPEG2-TS from ffmpeg

Posted: 19 May 2011 21:10
by ykori
In ffmpeg (libavformat/mpegtsenc.c), I had manually replaced the call to the function mpegts_insert_pcr_only with mpegts_insert_null_packet. This had fixed the problem for me at that time. Later I reverted to the original code in ffmpeg and the current version of VLC does not have a problem with it.