Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > (HD) DVD, Blu-ray & (S)VCD > (HD) DVD & Blu-ray authoring

Reply
 
Thread Tools Search this Thread Display Modes
Old 13th December 2008, 11:34   #1  |  Link
moviefan
Registered User
 
Join Date: Jul 2005
Posts: 438
HOWTO: calculate m2ts overhead?

Hi guys,

in order to exhaust the maximum space available of a chosen medium, I need to calculate the total overhead of the m2ts container, AC3, and DTS. Can anyone help me there or name a calculator for these formats? I haven't found one ...

Regards
moviefan
moviefan is offline   Reply With Quote
Old 13th December 2008, 15:47   #2  |  Link
turbojet
Registered User
 
Join Date: May 2008
Posts: 1,840
ripbot264 does a good job but it only supports 1 audio stream
turbojet is offline   Reply With Quote
Old 14th December 2008, 01:40   #3  |  Link
odin24
Registered User
 
odin24's Avatar
 
Join Date: Mar 2008
Location: The Great North (the better half of North America)
Posts: 301
It depends on the file types and sizes in the container. Is there a particular medium use generally use?

You can mux each stream to it's own m2ts, compare the muxed file and the raw file for the difference. Do this for all streams and it will give you a fairly accurate picture.

When I do my own DVD9's I always use h264 video and DTS @ 1536 kb/s, the overhead is pretty close to 570mb always. I have muxed a 2 hour TrueHD track once just for curiosity sake and the overhead was close to 1.3 GB... the track itself was close to 3.5 GB
odin24 is offline   Reply With Quote
Old 14th December 2008, 11:00   #4  |  Link
G_M_C
Registered User
 
Join Date: Feb 2006
Posts: 1,076
Quote:
Originally Posted by moviefan View Post
Hi guys,

in order to exhaust the maximum space available of a chosen medium, I need to calculate the total overhead of the m2ts container, AC3, and DTS. Can anyone help me there or name a calculator for these formats? I haven't found one ...

Regards
moviefan
I use a riugh percentage of the total size i want the project to reach ( 2 x DVD5, or 1 dvd9). In my experience a percentage of 6 percent should be good, but many times i use 7 to be sure
G_M_C is offline   Reply With Quote
Old 23rd December 2008, 14:20   #5  |  Link
ildocteur
Registered User
 
Join Date: Oct 2001
Posts: 18
If ripbot264 is close to geeting the optimal bitrate for a given media size would someone then be able to privide the formula used

I have been trying to find the source for ripbot264, but i don't think it's avaiable.

ildoc
ildocteur is offline   Reply With Quote
Old 23rd December 2008, 15:29   #6  |  Link
MadMonkey57
Duh!
 
MadMonkey57's Avatar
 
Join Date: Dec 2008
Location: France
Posts: 230
Here's what I do...

A DVD-R is approximately 2,298,496 sectors. With 2,048 bytes per sector, that makes it 4,707,319,808 bytes.

It is commonly accepted that the overhead for M2TS is about 6% - 7% (as G_M_C reported a couple of posts ago). Let's assume 7%.

4,707,319,808 - 7% = 4,377,807,421

In a typical movie only BD5, you need a few more kilobytes for the rest of the BD structure... and I am a rather conservative person... and I like round numbers... and I hate to waste time... so let's make it 4,375,000,000 bytes available for 1 video stream and 1/+ audio streams (and possibly subtitles streams... but let's ignore them in our case, they are pretty small anyway).

My next move is to approximate the optimal value for video bitrate given 1/+ audio streams :

Video_bitrate = ( 4,375,000,000 x 8 / 1024 / movie_length_in_sec ) - audio_bitrate

"4,375,000,000" is the total number of bytes available for video and audio
"x 8" turns this available space into bits
"/ 1024" turns this available space into kbits
"/ movie_length_in_sec" gives us the available bitrate in kbits/s for video and audio
The final step "- audio_bitrate" gives us the remaining space for the video

Example : a 1h30 movie, with 2 audio streams, 640kbits/s each, to fit on a DVD-R, what is the optimal video bitrate ?

Video_bitrate = ( 4,375,000,000 x 8 / 1024 / 5400 ) - 1280

Video_bitrate = 5049 kbits/s

Hope it helps.

Last edited by MadMonkey57; 23rd December 2008 at 15:48.
MadMonkey57 is offline   Reply With Quote
Old 23rd December 2008, 15:43   #7  |  Link
G_M_C
Registered User
 
Join Date: Feb 2006
Posts: 1,076
Quote:
Originally Posted by MadMonkey57 View Post
Here's what I do...

A DVD-R is approximately 2,298,496 sectors. With 2,048 bytes per sector, that makes it 4,707,319,808 bytes.

It is commonly accepted that the overhead for M2TS is about 6% - 7% (as G_M_C reported a couple of posts ago). Let's assume 7%.

4,707,319,808 - 7% = 4,377,807,421

In a typical movie only BD5, you need a few more kilobytes for the rest of the BD structure... and I am a rather conservative person... and I like round numbers... and I hate to waste media... so let's make it 4,375,000,000 bytes available for 1 video stream and 1/+ audio streams (and possibly subtitles streams... but let's ignore them in our case, they are pretty small anyway).

My next move is to approximate the optimal value for video bitrate given 1/+ audio streams :

Video_bitrate = ( 4,375,000,000 x 8 / 1024 / movie_length_in_sec ) - audio_bitrate

"4,375,000,000" is the total number of bytes available for video and audio
"x 8" turns this available space into bits
"/ 1024" turns this available space into kbits
"/ movie_length_in_sec" gives us the available bitrate in kbits/s for video and audio
The final step "- audio_bitrate" gives us the remaining space for the video

Example : a 1h30 movie, with 2 audio streams, 640kbits/s each, to fit on a DVD-R, what is the optimal video bitrate ?

Video_bitrate = ( 4,375,000,000 x 8 / 1024 / 5400 ) - 1280

Video_bitrate = 5049 kbits/s

Hope it helps.
Yep i reported 6%~7%, and i use 7% to be shure. But since the last few projects i've been recording filesizes before and after the mux. And in reality the percentage hovers around 5.6%. So if you really really really want to squeeze aut everyting you can get, than 6% should be doable.
G_M_C is offline   Reply With Quote
Old 23rd December 2008, 16:14   #8  |  Link
MadMonkey57
Duh!
 
MadMonkey57's Avatar
 
Join Date: Dec 2008
Location: France
Posts: 230
Quote:
Originally Posted by G_M_C View Post
Yep i reported 6%~7%, and i use 7% to be shure. But since the last few projects i've been recording filesizes before and after the mux. And in reality the percentage hovers around 5.6%. So if you really really really want to squeeze aut everyting you can get, than 6% should be doable.
If I'm not too lazy and not too coward, I'll try my next projects with 4,400,000,000 then...
MadMonkey57 is offline   Reply With Quote
Old 23rd December 2008, 22:56   #9  |  Link
n0mag!c
use 'r'
 
n0mag!c's Avatar
 
Join Date: Feb 2008
Posts: 230
Guys, I hope Atak_Snajpera will not be so lazy to share his formula with us.
Till then I'll be not so lazy to share my knowledge with you. Many years I use this formula for raw stream of any type:
Smb=Tmin*Bkb*0.0075, where
Smb - size in megabytes
Tmin - length of stream in minutes
Bkb - bitrate in kbits/s
0.0075 - is enough precise factor, you can easily try this formula for yourselfs.

We must use different CONTAINER FACTOR for different containers. And muxing test gives me 1.065 result for m2ts container.
for example: Total bitrate (kbit/s) will be 4700(media size) / CONTAINER FACTOR / Tmin / 0.0075.
Then video bitrate will be "Total bitrate" - "audio1 bitrate" - "audio2 bitrate" - ...

So G_M_C is quite right when using 7-8%%, especially if we wanna use subtitles...

Last edited by n0mag!c; 26th December 2008 at 21:58. Reason: that's it now
n0mag!c is offline   Reply With Quote
Old 23rd December 2008, 23:01   #10  |  Link
G_M_C
Registered User
 
Join Date: Feb 2006
Posts: 1,076
Quote:
Originally Posted by MadMonkey57 View Post
If I'm not too lazy and not too coward, I'll try my next projects with 4,400,000,000 then...
It's not about the laziness or cowardness, but usefull to know if you got a project to go on DVD5 and you absolutely want to squeeze every bit out of it that you can.

I use 1,07 (7%) normally, or sometimes 1,08 (8%) when i want to have some room to split the clip/movie into 2 DVD5's. The extra room gives me "playroom" to choose a nice split-point (on a chapter or scene-change for instance).
G_M_C is offline   Reply With Quote
Old 24th December 2008, 08:11   #11  |  Link
n0mag!c
use 'r'
 
n0mag!c's Avatar
 
Join Date: Feb 2008
Posts: 230
Quote:
Originally Posted by n0mag!c View Post
CONTAINER BITRATE
I did few tests and seems that I was wrong about it.
The conclusion is that final m2ts file size depends only on sizes of the muxing streams.
So I've edited my previous post to match new facts and not to confuse all readers.

Last edited by n0mag!c; 26th December 2008 at 21:53.
n0mag!c is offline   Reply With Quote
Old 24th December 2008, 09:47   #12  |  Link
MadMonkey57
Duh!
 
MadMonkey57's Avatar
 
Join Date: Dec 2008
Location: France
Posts: 230
Quote:
Originally Posted by G_M_C View Post
It's not about the laziness or cowardness, but usefull to know if you got a project to go on DVD5 and you absolutely want to squeeze every bit out of it that you can.

I use 1,07 (7%) normally, or sometimes 1,08 (8%) when i want to have some room to split the clip/movie into 2 DVD5's. The extra room gives me "playroom" to choose a nice split-point (on a chapter or scene-change for instance).
I meant lazyness coz it makes me change my habits.
And cowardness coz if for a specific movie it doesn't fit, I'll have to start it all over again, and it's a real pain...

But hey... it was just a joke, you know... Of course I'll try your settings (and thanks for the tip by the way).

Last edited by MadMonkey57; 24th December 2008 at 10:35. Reason: Disambiguation...
MadMonkey57 is offline   Reply With Quote
Old 28th December 2008, 09:52   #13  |  Link
MadMonkey57
Duh!
 
MadMonkey57's Avatar
 
Join Date: Dec 2008
Location: France
Posts: 230
Quote:
Originally Posted by MadMonkey57 View Post
... I'll try your settings (and thanks for the tip by the way).
@G_M_C
As promised, my report on the 4,400,000,000 bytes dedicated to audio/video (i used to use 4,375,000,000 in my formula). it works fine, tested so far on 4 movies, longest was 2h06mn, there's a longer one coming (n0mag!c found that the overhead could be dependent on the length of the movie).
MadMonkey57 is offline   Reply With Quote
Old 28th December 2008, 12:01   #14  |  Link
turbojet
Registered User
 
Join Date: May 2008
Posts: 1,840
Atak posted RipBot264's calculations here very accurate from my tests, except the new subtitle*2 added recently seems to undersize. I can understand why he did it though.
turbojet is offline   Reply With Quote
Old 28th December 2008, 13:53   #15  |  Link
n0mag!c
use 'r'
 
n0mag!c's Avatar
 
Join Date: Feb 2008
Posts: 230
Quote:
Originally Posted by MadMonkey57 View Post
n0mag!c found that the overhead could be dependent on the length of the movie
Sorry, I was wrong.
n0mag!c is offline   Reply With Quote
Old 28th December 2008, 14:20   #16  |  Link
odin24
Registered User
 
odin24's Avatar
 
Join Date: Mar 2008
Location: The Great North (the better half of North America)
Posts: 301
Quote:
Originally Posted by MadMonkey57 View Post
Example : a 1h30 movie, with 2 audio streams, 640kbits/s each, to fit on a DVD-R, what is the optimal video bitrate ?

Video_bitrate = ( 4,375,000,000 x 8 / 1024 / 5400 ) - 1280

Video_bitrate = 5049 kbits/s

Hope it helps.

MadMonkey57, do you think this formula will work with a TrueHD or DTS HD-MA track on a BD-R... just plug the proper numbers in?
odin24 is offline   Reply With Quote
Old 28th December 2008, 18:54   #17  |  Link
MadMonkey57
Duh!
 
MadMonkey57's Avatar
 
Join Date: Dec 2008
Location: France
Posts: 230
Quote:
Originally Posted by odin24 View Post
MadMonkey57, do you think this formula will work with a TrueHD or DTS HD-MA track on a BD-R... just plug the proper numbers in?
I can't confirm based on my experience coz I don't own a BD burner, but I can't think of an obvious reason why the formula couldn't apply to BD-RE and HD audio streams (would mean that M2TS muxing strategy is somehow based on the content itself...).

Last edited by MadMonkey57; 28th December 2008 at 18:55. Reason: typo
MadMonkey57 is offline   Reply With Quote
Old 28th December 2008, 18:55   #18  |  Link
MadMonkey57
Duh!
 
MadMonkey57's Avatar
 
Join Date: Dec 2008
Location: France
Posts: 230
Quote:
Originally Posted by n0mag!c View Post
Sorry, I was wrong.
Never mind...
MadMonkey57 is offline   Reply With Quote
Old 29th December 2008, 21:42   #19  |  Link
MadMonkey57
Duh!
 
MadMonkey57's Avatar
 
Join Date: Dec 2008
Location: France
Posts: 230
Quote:
Originally Posted by MadMonkey57 View Post
@G_M_C
As promised, my report on the 4,400,000,000 bytes dedicated to audio/video (i used to use 4,375,000,000 in my formula). it works fine, tested so far on 4 movies, longest was 2h06mn, there's a longer one coming (n0mag!c found that the overhead could be dependent on the length of the movie).
And my final comment on this... A 2h30mn movie fits on a DVD using 4,400,000,000 bytes in my formula. So cool !
MadMonkey57 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 20:47.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.