View Full Version : different video bitrates from muxes in mp4box vs. mp4creator
Stacey Melissa
9th April 2005, 10:01
It seems the latest build of mp4box from Celtic Druid fixes the issue the last one had with framerate error when muxing raw AVC files (created with CD's April 5th mencoder build) into .mp4. Now it seems to write the same framerate that mp4creator does (which is still off by a little, but not terrible on long clips).
But... muxing raw AVC into .mp4 via mp4box results in a slightly lower bitrate than doing the same thing via mp4creator. Here's the mp4info output for four test encodes. The first two are 101 frame clips; the last two are 1001 frames. The first and third are muxed from raw via mp4box; the second and fourth via mp4creator:
C:\Program Files\4ceCore\Utils>mp4info M2a.mp4
mp4info version 1.2.12
M2a.mp4:
Track Type Info
1 video H264 Main@4, 4.212 secs, 1345 kbps, 720x352 @ 23.979107 fps
2 audio MPEG-4 AAC LC, 4.266 secs, 185 kbps, 48000 Hz
C:\Program Files\4ceCore\Utils>mp4info M2b.mp4
mp4info version 1.2.12
M2b.mp4:
Track Type Info
1 video H264 Main@4, 4.212 secs, 1346 kbps, 720x352 @ 23.979107 fps
2 audio MPEG-4 AAC LC, 4.266 secs, 185 kbps, 48000 Hz
C:\Program Files\4ceCore\Utils>mp4info M2c.mp4
mp4info version 1.2.12
M2c.mp4:
Track Type Info
1 video H264 Main@4, 41.750 secs, 1719 kbps, 720x352 @ 23.976048 fps
2 audio MPEG-4 AAC LC, 4.266 secs, 185 kbps, 48000 Hz
C:\Program Files\4ceCore\Utils>mp4info M2d.mp4
mp4info version 1.2.12
M2d.mp4:
Track Type Info
1 video H264 Main@4, 41.750 secs, 1720 kbps, 720x352 @ 23.976048 fps
2 audio MPEG-4 AAC LC, 4.266 secs, 185 kbps, 48000 Hz
And the file size is smaller with the clips muxed via mp4box. 791KB versus 792KB for the 101 frame clip; 8868KB versus 8879KB for the 1001 frame clip.
I'm not complaining about reduced filesizes :p. I just hope mp4box isn't screwing things up in some subtle way.
bond
10th April 2005, 11:30
about the framerate thing: thats a rounding error in the calculation of the framerate. mp4 doesnt store a framerate number anywhere as for variable framerate streams that wouldnt make much sense
about the bitrate signalled: i assume one of the tools isnt really accurate in calculating the bitrate of the stream, but the number isnt really important anyways. whats the real bitrate of your stream?
about the different sizes: nothing to worry about, you dont have to expect that every muxer outputs exactly the same .mp4
Stacey Melissa
10th April 2005, 12:56
The filesize of the raw 101 frame encode that mencoder output was 708497 bytes, so 708497*8/1000*23.976/101 = 1345.498936 kbps. For the 1001 frame encode, it's 8974902*8/1000*23.976/1001 = 1719.738265 kbps.
But do I really know that that is the real bitrate of my video stream? I used to think I knew, but I'm not entirely sure now, given the things I've dug up today. Let's see what mp4box -info gives me for the video track of each of the above files (interesting stuff in blue):
C:\Program Files\4ceCore\Utils>mp4box -info 1 M2a.mp4
Track # 1 Info - TrackID 1 - TimeScale 24000 - Duration 00:00:04.212
Media Type "vide" - Media Sub Type "avc1" - 101 samples
MPEG-4 Config
Visual Stream - ObjectTypeIndication 0x21
AVC/H264 Video - Visual Size 720 x 352
Config Version 1 Profile 0x4d Level 0x28
Decoding Buffer size 13208 - Average bitrate 1313 kbps - Max Bitrate 226
7 kbps
No stream dependencies for decoding
StreamPriority 0
Computed info from media:
Total size 708253 bytes - Total samples duration 4212 ms
Average rate 1383 kbps - Max Rate 2267 kbps
C:\Program Files\4ceCore\Utils>mp4box -info 1 M2b.mp4
Track # 1 Info - TrackID 1 - TimeScale 90000 - Duration 00:00:04.212
Media Type "vide" - Media Sub Type "avc1" - 101 samples
MPEG-4 Config
Visual Stream - ObjectTypeIndication 0x21
AVC/H264 Video - Visual Size 720 x 352
Config Version 1 Profile 0x4d Level 0x28
Decoding Buffer size 0 - Average bitrate 0 kbps - Max Bitrate 0 kbps
No stream dependencies for decoding
StreamPriority 0
Computed info from media:
Total size 708457 bytes - Total samples duration 4212 ms
Average rate 1383 kbps - Max Rate 2267 kbps
C:\Program Files\4ceCore\Utils>mp4box -info 1 M2c.mp4
Track # 1 Info - TrackID 1 - TimeScale 24000 - Duration 00:00:41.750
Media Type "vide" - Media Sub Type "avc1" - 1001 samples
MPEG-4 Config
Visual Stream - ObjectTypeIndication 0x21
AVC/H264 Video - Visual Size 720 x 352
Config Version 1 Profile 0x4d Level 0x28
Decoding Buffer size 59157 - Average bitrate 1679 kbps - Max Bitrate 501
2 kbps
No stream dependencies for decoding
StreamPriority 0
Computed info from media:
Total size 8972658 bytes - Total samples duration 41750 ms
Average rate 1709 kbps - Max Rate 5012 kbps
C:\Program Files\4ceCore\Utils>mp4box -info 1 M2d.mp4
Track # 1 Info - TrackID 1 - TimeScale 90000 - Duration 00:00:41.750
Media Type "vide" - Media Sub Type "avc1" - 1001 samples
MPEG-4 Config
Visual Stream - ObjectTypeIndication 0x21
AVC/H264 Video - Visual Size 720 x 352
Config Version 1 Profile 0x4d Level 0x28
Decoding Buffer size 0 - Average bitrate 0 kbps - Max Bitrate 0 kbps
No stream dependencies for decoding
StreamPriority 0
Computed info from media:
Total size 8974662 bytes - Total samples duration 41750 ms
Average rate 1710 kbps - Max Rate 5013 kbps
So now I see that mp4box -info can figure out the max bitrate, but only when it also did the muxing of the raw video.
The timescale is different when muxed with mp4box versus mp4creator. Neither 90000 nor 24000 means much to me, though.
The most interesting thing is the calculated Total Size of the video stream. No matter the muxer, it's a little smaller than the .264 source file. And when mp4box is used as the muxer, it shows up a little smaller than when mp4creator is used for muxing.
More rounding error? :p Those GPAC and MPEG4IP guys are sure making it tough for poor old perfectionists like me. :D
bond
10th April 2005, 13:08
Originally posted by Stacey Melissa
[B]The filesize of the raw 101 frame encode that mencoder output was 708497 bytes, so 708497*8/1000*23.976/101 = 1345.498936 kbps. For the 1001 frame encode, it's 8974902*8/1000*23.976/1001 = 1719.738265 kbps.well for me thats also a rounding thingie (i wouldnt even call this a problem :D )
So now I see that mp4box -info can figure out the max bitrate, but only when it also did the muxing of the raw video.yep, mp4creator only seems to set the bitrate in the iods atom (which mp4info reads out), thats why you get the 0 values with mp4box
The most interesting thing is the calculated Total Size of the video stream. No matter the muxer, it's a little smaller than the .264 source file.the raw .264 is smaller than the resulting .mp4 as the muxers remove the SPS/PPS headers stored with every i-frame, and only store it once
And when mp4box is used as the muxer, it shows up a little smaller than when mp4creator is used for muxing.i think thats because mp4box is smart enough to check whether the nal header length can be reduced to 2 bytes (all encoders by default seem to always set the length to 4 bytes) if possible, which also saves bits, compared to mp4creator which always sets the header length to 4 bytes
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.