Log in

View Full Version : Stream size in MKVs


lolmaster
6th April 2016, 19:02
I see in some files, it shows video stream sizes of x264 tracks in mediainfo.
But in some, it does not show.
I muxed some using MKVtoolnix GUI myself and they don't show it either. AC3 tracks show the size, but not in x264 track or AAC.

Is there any way to mux them in a way that mediainfo shows the size of the x264 track (and AAC track, if can) using MKVToolnix GUI.
Thank you!

sneaker_ger
6th April 2016, 19:05
Use newest MKVToolnix and newest MediaInfo and do not disable track statistic tags in MKVToolnix. Then it should show for all tracks.

For files without such tags it cannot always be calculated. For example AC3 is typically constant bitrate so it is easy to calculate. AAC is usually variable bitrate so it is not as simple.

lolmaster
7th April 2016, 01:02
Thanks.
MKVToolnix version I tried is 9.0.1, the latest.
Mediainfo, not the latest. Like a month or 2 old. But does it matter here?
The files I see those info, are opened with same mediainfo program.
Mainly it is in x264 streams. I see them in some. If I mux same file again, or a different file, I dont see it. I just add and mux, never changed anything in settings. Where are settings for "track statistic tags"? I never changed anything!

kuchikirukia
7th April 2016, 03:43
Oh neat, that's new.

http://s17.postimg.org/9ga9vd327/Untitled.png (http://postimage.org/)

osgZach
7th April 2016, 05:25
Use newest MKVToolnix and newest MediaInfo and do not disable track statistic tags in MKVToolnix. Then it should show for all tracks.

For files without such tags it cannot always be calculated. For example AC3 is typically constant bitrate so it is easy to calculate. AAC is usually variable bitrate so it is not as simple.

That makes no sense. The file size of the added file is the file size of that chunk of data sitting in the MKV container. How can it not calculate that? Bitrate should have nothing to do with it.

sneaker_ger
7th April 2016, 08:25
I didn't say it cannot be calculated at all. But to do it you would have to deep probe the file as mkv does not have that information readily available in the headers (except for the new, completely optional statistic tags). If it's a CBR stream MediaInfo can just multiply bitrate and duration to come up with the stream size.

hello_hello
8th April 2016, 02:11
That makes no sense. The file size of the added file is the file size of that chunk of data sitting in the MKV container. How can it not calculate that? Bitrate should have nothing to do with it.

I just checked, and for VBR MP3 MediaInfo is happy to display both the video and audio bitrates, durations and stream size, even without track statistic tags. It's also displaying the same when the audio is AC3, so I'm not sure the OP is completely correct. For MP3 in an MKV MediaInfo displays the same info as it does for the MP3 itself, so I assume that info is written to the stream and retained when muxing so it's easy for MediaInfo to dig it out. I thought that's how it works for AC3 too. The video bitrate MediaInfo calculates from there isn't always exact, but it's pretty close. I'm pretty sure MP3 streams contain duration info as well as bitrate info and I'd be surprised if the same wasn't true for AC3.

The problem with AAC streams is without track statistic tags being created the bitrate/duration info simply isn't there. Fully scanning a large MKV can take a while (try opening one with Bitrate Viewer). Information such as the encoder used to create the AAC is lost when remuxing to MKV, so I assume it's written to the container (M4A, MP4 etc) when the audio is encoded and not the audio stream itself. If you open a raw VBR AAC stream with MediaInfo, it doesn't even try to guess the bitrate or duration. Some programs give it a go so you can navigate. The AAC stream I opened with MPC-HC was 29 minutes long but MPC-HC displayed 28 minutes and 27 seconds. VLC updates the estimated duration as playback progresses. MP3DirectCut was out by about three and a half minutes. foobar2000 will play raw AAC but you can't navigate.
Oddly enough, MP3Tag was the one program I tried that appeared to take the time to scan raw AAC and get it right.... to within about 2kbps.