[FFmpeg-user] PCR, muxrate and DVBT

Massimo Battistel battistel at gmail.com
Fri Nov 1 16:35:56 CET 2013

Some updates.

With the following script:

ffmpeg -re -i video.mpg -vf scale="720:576" -aspect 4:3 -vcodec mpeg2video
-g 12 -bf 2 -pix_fmt yuv420p -b:v 2150k -maxrate 2200k -bufsize 2200k
-acodec mp2 -ac 2 -ar 48000 -ab 128k -async 48000 -streamid 0:256 -streamid
1:512 -f mpegts udp://[IP]:[port]?pkt_size=1316

we can now send the stream to the decoder.
The problem is that audio and video goes out of sync after one hour.

After some googling, it seems this is related to PCR interval too big. Most
hw decoders want a pcr interval < 40ms (sniffing some hw encoder output
streams, 30ms seems to be the correct value).
Looking at the sources of "mpegtsenc.c" it seems the shortest pcr interval
I can achieve is 80ms (for 25 fps). Even various combination of "-muxrate"
and "-max_delay" parameters did not help.

Let me know if this script can be improved and if there is way to obain a
30ms pcr interval.
If not, would it be possible to add a "-mpegts_pcr_interval" option? This
would considerably improve compatibility with most hw decoders and STBs.


2013/10/30 Massimo Battistel <battistel at gmail.com>

> hello,
> I have to send through udp an mpeg-ts (v:mpeg2, a:mp2) to an hardware
> decoder. Before writing the script, I've read something about the argument
> finding a bit of confusion.
> I have these questions (for now):
> 1. How to set PCR from command line?
> 2. DVBT needs PCR < 40?
> 3. Is there any relation between PCR and "-muxrate" parameter?
> thanks,
> MB

Massimo Battistel.

More information about the ffmpeg-user mailing list