[vlc-devel] [RFC] Don't trust the PCR by default

Robert Forsman bob.forsman at ericsson.com
Mon Mar 17 16:47:12 CET 2014


On Mon, 17 Mar 2014 04:42:33 +0100
Francois Cartegnie <fcvlcdev at free.fr> wrote:

> Le 16/03/2014 19:10, Denis Charmet a écrit :
> > The TS demux is PCR master but broken streams may have invalid PCR which stops the playback or at least the playback of some tracks.
> > Those file can be played with --demux=avformat since it uses the minimum dts off all the tracks as PCR.
> > 
> > The following patch implements the same thing.
> > 
> > Any idea/comments on this PoC?
> 
> This kind of fix needs an observation window, or can't be that easy.
> 
> You can't ask the user to specify to trust pcr or not. Otherwise, just
> use avcodec. So you need to check is PCR is accurate, and estimate gap
> which needs to watch some packets.

A few years ago I was often up to my elbows in transport streams
troubleshooting problems, but I haven't done much more than adaptive
bit rate and segmentation work recently.


The only thing I ever used PCRs for was when I was transmitting
transport streams over UDP and checking the quality of MUXers (like
generating graphs that showed old versions of ffmpeg were sometimes
*facepalm* broken).

When it comes to playback I would only care about DTS, and even that
can be discontinuous (like if you were capturing a stream from a
hardware encoder during a reboot or reconfiguration, or just an ATSC
stream during a commercial splice).

If you ARE going to be picky about PCRs, you might want to consider
collecting a library of media which have broken PCRs and cause VLC to
malfunction, and develop repair recipes for each broken media (like
"don't use that version of ffmpeg"), so people who encounter MORE
broken media have repair options.

Now if the streams are generated by broken software they do not have
the ability to fix, then a picky VLC becomes useless to them.


I have one ABR hardware transcoder/segmenter that refuses to accept an
MPEG transport stream transmitted from a linux host because there is
too much jitter.  When the OS sometimes delays you for 10 milliseconds,
jitter is unavoidable.  Needless to say, that hardware is useless
unless you have a lab full of $20K broadcast equipment.  This is what
happens when your gear is a picky picky princess.



More information about the vlc-devel mailing list