View Full Version : AVI overhead
Inventive Software
22nd March 2005, 14:23
OK, not a new container, but still a useful question.
Anybody know the amount of overhead that AVI uses per hour say? I can't quite pinpoint a figure on it and need a little help with it.
Thanks.
stephanV
22nd March 2005, 15:29
for legacy: 24 bytes/chunk (a chunk is e.g one video frame or a number of audio samples)
for OpenDML: 16 bytes/chunk
bond
22nd March 2005, 15:40
vbr audio streams will cause a bigger overhead than cbr audio streams (eg mp3)
stephanV
22nd March 2005, 15:53
No thats not true, it depends completely how you pack the data. It is true that with NanDub or VirtualDubMod you get normally larger file sizes with VBR MP3 as with a CBR MP3 stream, but nothing is withholding you from packing more than one MP3-frame per chunk (which those apps dont support and causes lower overhead).
For audio steams you cannot make any valid assumptions about the overhead it causes, unless you know how it is interleaved.
Inventive Software
26th March 2005, 15:13
If it helps, I'm using CBR MP3 audio. But thanks stephenv, that's gonna make the overhead calculation a bit easier. Do you know how many audio samples it is per chunk?
stephanV
26th March 2005, 18:11
i believe in VirtualDub(Mod) CBR MP3 audio is interleaved with chunks of 0.5 seconds. So total number of chunks is [video duration in seconds]*2.
Inventive Software
31st March 2005, 15:59
OK, the number of (raw) samples is 1920 for every second, if the audio and video streams are the same length exactly.
So that would make audio chunks 960 samples big, right?
stephanV
31st March 2005, 17:11
not really... (sorry i made a mistake in my assumption of interleaving in VirtualDub)
ill give you an example:
you have a video stream of 25 fps, 300 seconds long, and CBR MP3 stream (any bitrate) 299 seconds long... and you want to interleave them. what will be the overhead?
each video frame will be in its own chunk, so we have 25*300 = 7500 chunks
for the audio we need to look at the interleaving settings, by default in VDub it is 1 chunk per video frame. therefor, the length of the data in an audio chunk is equal to a video chunk = 1/25 = 0.04s.
since the audio stream is 299 seconds, the total number of chunks needed is 299/0.04 = 7475
now you have a total of 7500+7475 = 14975 chunks, from which you should be able to calculate the overhead.
If you want to reduce the overhead caused by audio, you can do it by changing the interleaving settings.
Inventive Software
1st April 2005, 16:21
OK, I did some more tests, I'm frameserving VDM with AviSynth 2.55, it's decoding an MPEG2 video stream and an AC3 audio stream. Because of the way VDM works, it treats the input streams with AVS as if they are raw, which makes them easier to work with (tell me I'm right, please??). The audio codec I'm using for encoding is LAME 3.96.1 ACM. I don't know how this affects it.
I'll give you some stats that you can work with.
No of frames: 205985
Video length: 8239.4 seconds
Audio Length: 8238 seconds
Based on the 24 bytes/frame for video and 48 bytes/sec for CBR MP3 audio, there should be 24*205985 bytes of video overhead, and 48*8238 bytes of audio overhead, right?
When I calculate the audio file, it's based upon the audio bitrate that I'm using, which is 128 Kbits/sec (16 KB/sec). So with this in mind, the audio size should be 16*8238 KB. Right?
Also, with the audio encoded in the file, if I demux the audio file from the resultant AVI file, it turns out smaller than I calculated. Do you know why this is?
stephanV
1st April 2005, 18:00
Originally posted by Inventive Software
Based on the 24 bytes/frame for video and 48 bytes/sec for CBR MP3 audio, there should be 24*205985 bytes of video overhead, and 48*8238 bytes of audio overhead, right?
IF you interleave the audio every 0.5 seconds (is not default in VirtualDub!) and mux into a standard AVI, you are right.
When I calculate the audio file, it's based upon the audio bitrate that I'm using, which is 128 Kbits/sec (16 KB/sec). So with this in mind, the audio size should be 16*8238 KB. Right?
Not entirely:
128 kbits = 128000 bits = 16000 bytes = 15.625 kbytes (1 kB = 1024 bytes)
Also, with the audio encoded in the file, if I demux the audio file from the resultant AVI file, it turns out smaller than I calculated. Do you know why this is?
See previous answer ;)
Inventive Software
4th April 2005, 14:22
OK, that's where I've been going wrong. Thanks for that, it was kinda mind-boggling, and it was starting to get on my nerves! :D
Having not used it in a while, what is the default interleave time for VirtualDubMod? I'm using a library computer to use the internet, and I can't remember the options for VDM.
OK, so with these new calculations, the audio size is NOT 16*8238 KB, but instead is 16000*8238 bytes, which can be converted to KB when I find a computer with Calculator on it. :) The audio overhead will still be the same provided it is interleaved every 0.5 seconds, right?
I think I'm starting to get this. :D
stephanV
4th April 2005, 14:48
Having not used it in a while, what is the default interleave time for VirtualDubMod? I'm using a library computer to use the internet, and I can't remember the options for VDM.
It interleaves audio every 1 video video frame
OK, so with these new calculations, the audio size is NOT 16*8238 KB, but instead is 16000*8238 bytes, which can be converted to KB when I find a computer with Calculator on it. :) The audio overhead will still be the same provided it is interleaved every 0.5 seconds, right?
yes
Inventive Software
5th April 2005, 15:18
Hooray!! I may be getting somewhere with this at last! :D:D:D
So with the default interleave settings in VDM, and using the stats below as an example, that would make the audio overhead 24*205950 bytes, right?
Still having not used VDubMod in a while, can that inteleaving option be changed? My memory has gone to pot in the last few days. :(
If you really want to know why I'm doing this (thanks very much for the information btw, it has helped no end :)), wait a few more days, and all will become clear. ;) It's to do with a codec test I'm gonna perform, and I'm still working on the final draft of the planning document.
stephanV
5th April 2005, 18:22
Originally posted by Inventive Software
So with the default interleave settings in VDM, and using the stats below as an example, that would make the audio overhead 24*205950 bytes, right?
Yup
Still having not used VDubMod in a while, can that inteleaving option be changed? My memory has gone to pot in the last few days.
Streams --> streams list, right click on the audio stream IIRC (I havent used VDubMod in ages either...)
DarkDudae
5th April 2005, 22:18
You can find usefull info about overhead for different containers in Alexnoe web (http://www-user.tu-chemnitz.de/~noe/Video-Zeug/AVIMux%20GUI/en_estimate_overhead.html).
Greetings
Inventive Software
6th April 2005, 14:00
Thanks DarkDudae, but that's really more than I need. I just need a fairly accurate estimation for the overhead to calculate the video bitrate. Knowing how to calculate the exact audio size as well makes things so much easier. :D
I think I got all the information I need. Time to finish the draft of the codec test planning document and get it ready for upload.
Then to do the tests. With my system specs it may take a while. :(
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.