[FFmpeg-devel] [BUG] PCR, PTS drift for mpegts streams. Black screen on set-top box.

Olof Astrand olof_astrand
Fri Jun 5 10:29:51 CEST 2009



> >>
> >> On 6/3/2009 8:17 AM, Olof Astrand wrote:
> >>> Hello,
> >>>
> >>> I have been trying to get ffmpeg to stream a screen capture (x11grab)
> >>> to a set top box. Unfortunately ffmpeg has not been so successful so
> >>> far. It seems like mpegtsenc.c does not set or calculate PCR
> >>> correctly.
> >>>
> >>> I have not gone into the details yet but would really like some help
> >>> or pointers if someone is working on this problem, or know anything
> >>> about it.
> >>>
> >>> When I set ts->cur_pcr to the current pts for the audio stream like
> >>> this:
> >>>
> >>> + if (pts != AV_NOPTS_VALUE) {
> >>>
> >>> + ts->cur_pcr = pts-90000;
> >>>
> >>> + }
> >>>
> >>> Then at I get an image for a while, otherwise the image on the set
> >>> top box is black.
> >>>
> >>
> >> PCR is related to DTS, and yes this is a known problem. It should work
> >> better in CBR mode, ie with rc_max_rate set and respected.
> >
> > Baptiste, can you please give the explicit command-line switches and
> > values to use for the CBR mode ?
> >
> > Also, an IP box is not likely to expect the stuffing used to reach the
> > constant bitrate, so it might not fully work, right ?
> >
> >> A fully working buffering model for the TS muxer is needed, patch very
> >> welcome.
> >
> > The problem is that the real experts here are you, Mans, Michael... what
> > can we do to help you give this a higher priority ? Do you need further
> > characterizations of the problem, or is every aspect of it well known ?
> >
> > FWIW, here in my company, this very problem makes us dependent on vlc
> > for TS muxing, which induces extra latency and instability (vlc has bugs
> > too, though fewer in the TS muxer :-P ). So it is THE dark spot about
> > ffmpeg which is absolutely perfect otherwise.
> 
> well, you being inside a not so small company could convince said company
> to sponsor somebody to do that work, given that you need it so badly, no?
> 

I think that if the PCR problem is corrected and null packet insertion is added to achive CBR flow 
then many STB:s will gladly accept the ts stream. It might even work better than vlc. 
Maybe that is incentive enough to fix this ffmpeg bug?

I attach Opencaster:s ts vbr to cbr converter, something similar built into mpegtsenc.c
would be perfect.

/Olof ?strand






_________________________________________________________________
Show them the way! Add maps and directions to your party invites. 
http://www.microsoft.com/windows/windowslive/products/events.aspx
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tsvbr2cbr.c
Type: text/x-csrc
Size: 7639 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090605/9f137bd9/attachment.c>



More information about the ffmpeg-devel mailing list