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 > Capturing and Editing Video > New and alternative a/v containers

Reply
 
Thread Tools Search this Thread Display Modes
Old 27th August 2006, 18:53   #1  |  Link
Doom9
clueless n00b
 
Join Date: Oct 2001
Location: somewhere over the rainbow
Posts: 10,579
overhead of vobsub subs inside mp4/mkv

Does anybody have any reliable data / formulas on the mux overhead of this scenario?
__________________
For the web's most comprehensive collection of DVD backup guides go to www.doom9.org
Doom9 is offline   Reply With Quote
Old 27th August 2006, 19:34   #2  |  Link
GodofaGap
Registered User
 
Join Date: Feb 2006
Posts: 823
You would need to know the amount of subpictures to make any meaningful estimation of that. On the scale of video and audio it is probably negligible. Also remember that by default Matroska (mkvmerge) uses zlib compression for vobsubs which complicates the estimation even more.

IOW - I don't think such a thing is possible. The only thing you could do is create a .mks with the subtitle you have and measure the size of that.
GodofaGap is offline   Reply With Quote
Old 27th August 2006, 19:55   #3  |  Link
Doom9
clueless n00b
 
Join Date: Oct 2001
Location: somewhere over the rainbow
Posts: 10,579
well.. I'd depart from knowing how large the .idx and .sub file is.. I could even throw the size of a zipped .sub file into the mix.. and I'm not friend of empirical measures in this case.. there are usually formulas that those who came up with the container know about.
__________________
For the web's most comprehensive collection of DVD backup guides go to www.doom9.org
Doom9 is offline   Reply With Quote
Old 27th August 2006, 20:04   #4  |  Link
emmel
Registered User
 
Join Date: Feb 2006
Posts: 133
Correct me if I'm wrong, but when muxed in mp4, the overhead is actually "negative".

To be more precise, the vobsub-files (*.sub) are first demuxed to get rid of the mpeg2 ps/pes headers and padding, after which the resulting spu's (plus some headers, of course) are placed into the mp4 stream. Practical example:

$ls -la
a.mp4 713322899 bytes
b.idx 56638 bytes
b.sub 4001792 bytes

$ MP4Box -add b.idx a.mp4
$ ls -la a.mp4
a.mp4 715960055 bytes

There is a saving of 1,4M in this case. I'm unable to say whats the size of mp4-header data in general. But it must be small compared to the number of mpeg2 header and padding bytes thrown away.

[edit] Simple formula for average "compression" when importing vobsubs in mp4:

- 53 header bytes / sub are discarded (the average number of pes-packets / sub picture is two. There are 29 header bytes in the first packet, and 24 bytes in the second)

- 1012 padding bytes / sub are discarded (if the length of the sub picture units (modulo pes packet size) is random, approximately half of the 2048-24=2024 data bytes of the last packet carries payload - the rest is subject to padding).

The total compression is thereby about 1k / sub. In the previous example, there were 1250 subs, which gives a total of 1,35M discarded bytes. Close enough to practice, imho.

Maybe it would be more accurate to talk about overhead, if it were possible to mux sup-files into mp4.

Last edited by emmel; 27th August 2006 at 21:31.
emmel is offline   Reply With Quote
Old 27th August 2006, 20:12   #5  |  Link
GodofaGap
Registered User
 
Join Date: Feb 2006
Posts: 823
Quote:
well.. I'd depart from knowing how large the .idx and .sub file is.. I could even throw the size of a zipped .sub file into the mix..
If you are willing to do that, I don't see what the problem is with creating a subtitle only mkv first. It will probably give you more accurare result than any formula can.
GodofaGap is offline   Reply With Quote
Old 29th August 2006, 10:48   #6  |  Link
Haali
Registered User
 
Join Date: Jul 2003
Posts: 282
It's rather hard to predict overhead because the subs themselves are compressed with zlib when stored in matroska. To get accurate sizes you'd need to mux a subs-only file and run mkvverify on it.
Haali is offline   Reply With Quote
Old 29th August 2006, 17:16   #7  |  Link
Doom9
clueless n00b
 
Join Date: Oct 2001
Location: somewhere over the rainbow
Posts: 10,579
well... I can always use sharpziplib to compress the sub file, and that will give a rather reliable estimate. I'm not so concerned about the compression though, as I know this isn't perfectly reliable.. but I'd like to get an idea of the overhead so that I can at least take proper care of that. Running yet another commandline program is out of the question here.
__________________
For the web's most comprehensive collection of DVD backup guides go to www.doom9.org
Doom9 is offline   Reply With Quote
Old 29th August 2006, 20:32   #8  |  Link
Haali
Registered User
 
Join Date: Jul 2003
Posts: 282
Overhead should be pretty much the same as for other video codecs, frames are stored in the same way after all.
Haali is offline   Reply With Quote
Old 31st August 2006, 19:46   #9  |  Link
Prettz
easily bamboozled user
 
Prettz's Avatar
 
Join Date: Sep 2002
Location: Atlanta
Posts: 373
Quote:
Originally Posted by Doom9
well... I can always use sharpziplib to compress the sub file, and that will give a rather reliable estimate. I'm not so concerned about the compression though, as I know this isn't perfectly reliable.. but I'd like to get an idea of the overhead so that I can at least take proper care of that. Running yet another commandline program is out of the question here.
Reliable bitrate calculators are kinda important, though! And since .sub subtitles are pretty big (several MB), that makes a pretty big difference when I'm trying to get my encode exactly 700MB on the first try. After being duped several times now by the bitrate calculator in MeGUI, I'd be willing to wait any amount of time to get a totally accurate bitrate calculation.
Prettz is offline   Reply With Quote
Old 31st August 2006, 20:32   #10  |  Link
Doom9
clueless n00b
 
Join Date: Oct 2001
Location: somewhere over the rainbow
Posts: 10,579
Quote:
After being duped several times now by the bitrate calculator in MeGUI,
Did I miss your several detailed reports ?
__________________
For the web's most comprehensive collection of DVD backup guides go to www.doom9.org
Doom9 is offline   Reply With Quote
Old 3rd September 2006, 03:14   #11  |  Link
Prettz
easily bamboozled user
 
Prettz's Avatar
 
Join Date: Sep 2002
Location: Atlanta
Posts: 373
Quote:
Originally Posted by Doom9
Did I miss your several detailed reports ?
No this just happened a couple days ago. I only just started using MeGUI. But my final .mkv file kept coming out about 2 MB or a little more short of what I expected after muxing my audio.

It might have something to do with how the video hr/min/sec controls and # of frames control change their values a little unexpectedly. And when I entered my actual # of frames, it changed the number of seconds from the correct value to a really wrong one. I could not get both values to be correct at the same time. I don't remember which I left correct, the # of frames or the # of seconds, however. The calculator must have used the value that became incorrect to calculate the video overhead.
Prettz 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 10:38.


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