[FFmpeg-user] MPEG-TS PCR Accuracy over +-500ns

袁竞杰 yuanjingjie1987 at 126.com
Tue Nov 26 12:55:00 CET 2013

 I used muxrate and got 20ms  PCR interval too,but PCR accuracy is over +-500ns.
Reading  source code in mpegtsenc.c ,I find muxrate is used to count PCR.
Since null packet are added to keep muxrate stable, it seems no reason PCR is inaccuracy.
Where does the jitter come from? Please give me some advice, if anyone knows.
When forcing CBR , bitrate is jitter too.
So we have to set a higher muxrate,and add more null packet to keep muxrate constant,it wastes some bandwidth. 


At 2013-11-26 18:34:57,"Massimo Battistel" <battistel at gmail.com> wrote:
>>    I have a problem using mpegts muxer, and I need your help.
>>    In order to get a better PCR accuracy ,I  set -muxrate and use CBR .
>>    But PCR accuracy of MPEG-TS is still over +-500ns,about +-600ns~700ns.
>>    Is it a bug of ffmpeg?How can I keep PCR accuracy within +-500ns?
>I've asked the same question some time ago (with no answer).
>My problem was sending a transport stream (mpeg2, mp2) to an hardware
>Using -muxrate I've been able to obtain about 20ms for PCR interval, which
>is good enough to stay below 500ns of clock jitter.
>Also forcing CBR is good (for some decoders mandatory) to reach the goal.
>But that was not enough.
>The steps that made the difference were:
>1. specify -minbitrate too.
>2. use -bufsize bigger than bitrate (in my case ~1.8 * bitrate).
>3. set -muxrate value like bufsize (1.8 * bitrate).
>This worked for me (decoder now works 24/7). Everything was very empirical
>anyway, my guess is that a *real* constant bitrate for mpeg2 is not
>possible to obtain.
>Keep also in mind that different hw decoders may require different setting
>(mine is Scopus).
>ffmpeg-user mailing list
>ffmpeg-user at ffmpeg.org

More information about the ffmpeg-user mailing list