Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: MPEG-system overhead (Read 5013 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

MPEG-system overhead

I've spent way too much time trying to figure out the formula for calculating the amount of overhead in an multiplexed audio-video MPEG file. It seems to vary by audio bitrate, video bitrate, plus some other magic stuff I don't know of. Even encoding the same file at assorted bitrates yields a very strange-looking graph of overhead/bitrate distribution.

The only reason I'm actually interested in this is because I need to be able to calculate the overall file bitrate, but I've only figured out how to pull out the bitrates of the component video and audio portions, but the ~1-5% overhead is throwing off all my playtime calculations by an unacceptable amount.

So - I guess my real question is "How do I calculate the correct playtime for a multiplexed MPEG video+audio file?"

MPEG-system overhead

Reply #1
Please forgive me if I sound stupid... but one simple idea just pop up.
Do you know how to find the frame rate of the video?
If you know the amount of frames and the frame rate, it should be very simple to calculate the playtime.
muaddib

MPEG-system overhead

Reply #2
I know the frame rate, yes, but I don't know how many frames there are total. That would be too easy 

Right now I'm assuming that total_bitrate == video_bitrate + audio_bitrate + multiplexing_overhead, where multiplexing_overhead is calculated by a convoluted interpolation/lookup formula based on observed bitrate deviations, but I still can't get better than 98% accuracy in some cases.

MPEG-system overhead

Reply #3
It would be difficult to pinpoint your problem without knowing the details of your implementations.. Are you multiplexing a pre-encoded video and audio stream?

MPEG-system overhead

Reply #4
are you trying to mux a .mpeg/.mpg file or .mp4?

if you mux into .mp4 you can be sure that the resulting mp4 is smaller than the source avi for example (well mp4 is the native container, especially designed for mpeg-4 content)
I know, that I know nothing (Socrates)

MPEG-system overhead

Reply #5
Quote
I know the frame rate, yes

No, you dont. a MPEG2 video file can change the framerate in the middle of the file, the headers tells you nothing about that ....