[FFmpeg-devel] ffmpeg mpegts muxing overhead

Tomas Härdin tomas.hardin
Tue Jan 18 08:38:20 CET 2011


Pushkar Pradhan skrev 2011-01-18 01:39:
> I need to be able to predict the mpegts muxing overhead before the actual
> muxing happens.
Why? Also, does it need to be exact, or can it be an overestimate?
> I have basic stream information available like video frame
> rate, audio sampling frequency, duration and size.
> I first thought there is a theoritical minimum I can calculate by looking at
> the !SO 13818 part 1 specifications but I think there is a lot of freedom in
> implementation.
> E.g. the spec says PCR packets must be sent every 100 msec but looking at
> mpegtsenc.c I think it is configurable and the default is less than 100
> msecs, am I correct?
Usually. Unfortunately it can end up > 100 ms in some cases (VFR, low 
frame rate).
> So I am thinking at this point, the best way to find the theoritical minimum
> overhead is to read ffmpeg ts muxing code.
I would say this is the only way, for almost all muxers.
> Any suggestions?
Try to model the muxer's behaviour outside it. Or just allocate some 
constant number of bytes for fixed overhead plus a percentage of the 
total size of the essence.

This whole thing sounds very risky though, since any muxer's behavior is 
likely to change without notice. This is especially true for mpegts, 
since the muxer is.. suboptimal. What exactly are you trying to do?

/Tomas



More information about the ffmpeg-devel mailing list