VideoHelp Forum
+ Reply to Thread
Results 1 to 5 of 5
Thread
  1. I'm going to resurrect this thread because I have noticed this as well and always wondered why it does this.
    So I have a mp4 file that's 131MB, if I run it through mkvtoolnix it comes out as 106MB.
    When checking the media info, the size difference is apparent in the video stream.

    MP4:
    Code:
    General
    Complete name                  : C:\Portable Apps\youtube-dl\testfile.mp4
    Format                         : MPEG-4
    Format profile                 : Base Media / Version 2
    Codec ID                       : mp42 (mp42/isom)
    File size                      : 131 MiB
    Duration                       : 2 min 15 s
    Overall bit rate mode          : Constant
    Overall bit rate               : 8 135 kb/s
    Encoded date                   : UTC 2019-03-19 18:47:57
    Tagged date                    : UTC 2019-03-19 18:47:57
    
    Video
    ID                             : 1
    Format                         : AVC
    Format/Info                    : Advanced Video Codec
    Format profile                 : High@L4
    Format settings, CABAC         : Yes
    Format settings, RefFrames     : 3 frames
    Codec ID                       : avc1
    Codec ID/Info                  : Advanced Video Coding
    Duration                       : 2 min 15 s
    Bit rate mode                  : Constant
    Bit rate                       : 8 000 kb/s / 8 000 kb/s
    Maximum bit rate               : 9 146 kb/s
    Width                          : 1 920 pixels
    Height                         : 1 080 pixels
    Display aspect ratio           : 16:9
    Frame rate mode                : Constant
    Frame rate                     : 23.976 (24000/1001) FPS
    Color space                    : YUV
    Chroma subsampling             : 4:2:0
    Bit depth                      : 8 bits
    Scan type                      : Progressive
    Bits/(Pixel*Frame)             : 0.161
    Stream size                    : 129 MiB (98%)
    Title                          : Telestream, LLC Telestream Media Framework - Release TXGP 2017.104.228761
    Writing library                : x264 core 148
    Encoding settings              : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=8 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / paff=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=0 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=cbr / mbtree=1 / bitrate=8000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=8000 / vbv_bufsize=1400 / nal_hrd=cbr / filler=1 / ip_ratio=1.40 / aq=1:1.00
    Encoded date                   : UTC 2019-03-19 18:47:57
    Tagged date                    : UTC 2019-03-19 18:47:57
    Color range                    : Limited
    Color primaries                : BT.709
    Transfer characteristics       : BT.709
    Matrix coefficients            : BT.709
    
    Audio
    ID                             : 2
    Format                         : AAC
    Format/Info                    : Advanced Audio Codec
    Format profile                 : LC
    Codec ID                       : 40
    Duration                       : 2 min 15 s
    Source duration                : 2 min 15 s
    Bit rate mode                  : Constant
    Bit rate                       : 128 kb/s
    Channel(s)                     : 2 channels
    Channel positions              : Front: L R
    Sampling rate                  : 48.0 kHz
    Frame rate                     : 46.875 FPS (1024 SPF)
    Compression mode               : Lossy
    Stream size                    : 2.02 MiB (2%)
    Source stream size             : 2.02 MiB (2%)
    Title                          : Telestream, LLC Telestream Media Framework - Release TXGP 2017.104.228761
    Language                       : English
    Encoded date                   : UTC 2019-03-19 18:47:57
    Tagged date                    : UTC 2019-03-19 18:47:57

    MKV:
    Code:
    General
    Unique ID                      : 146768669428816395997566295274298252809 (0x6E6A9E16C7792C418AB9BA14EFDB9E09)
    Complete name                  : C:\Portable Apps\youtube-dl\testfile.mkv
    Format                         : Matroska
    Format version                 : Version 4 / Version 2
    File size                      : 107 MiB
    Duration                       : 2 min 15 s
    Overall bit rate               : 6 626 kb/s
    Encoded date                   : UTC 2019-08-08 04:39:40
    Writing application            : mkvmerge v35.0.0 ('All The Love In The World') 64-bit
    Writing library                : libebml v1.3.9 + libmatroska v1.5.2
    
    Video
    ID                             : 1
    Format                         : AVC
    Format/Info                    : Advanced Video Codec
    Format profile                 : High@L4
    Format settings, CABAC         : Yes
    Format settings, RefFrames     : 3 frames
    Codec ID                       : V_MPEG4/ISO/AVC
    Duration                       : 2 min 15 s
    Bit rate mode                  : Constant
    Bit rate                       : 6 500 kb/s
    Nominal bit rate               : 8 000 kb/s / 8 000 kb/s
    Width                          : 1 920 pixels
    Height                         : 1 080 pixels
    Display aspect ratio           : 16:9
    Frame rate mode                : Constant
    Frame rate                     : 23.976 (24000/1001) FPS
    Color space                    : YUV
    Chroma subsampling             : 4:2:0
    Bit depth                      : 8 bits
    Scan type                      : Progressive
    Bits/(Pixel*Frame)             : 0.131
    Stream size                    : 105 MiB (98%)
    Writing library                : x264 core 148
    Encoding settings              : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=8 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / paff=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=0 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=cbr / mbtree=1 / bitrate=8000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=8000 / vbv_bufsize=1400 / nal_hrd=cbr / filler=1 / ip_ratio=1.40 / aq=1:1.00
    Language                       : English
    Default                        : Yes
    Forced                         : No
    Color range                    : Limited
    Color primaries                : BT.709
    Transfer characteristics       : BT.709
    Matrix coefficients            : BT.709
    
    Audio
    ID                             : 2
    Format                         : AAC
    Format/Info                    : Advanced Audio Codec
    Format profile                 : LC
    Codec ID                       : A_AAC
    Duration                       : 2 min 15 s
    Bit rate                       : 125 kb/s
    Channel(s)                     : 2 channels
    Channel positions              : Front: L R
    Sampling rate                  : 48.0 kHz
    Frame rate                     : 46.875 FPS (1024 SPF)
    Compression mode               : Lossy
    Stream size                    : 2.02 MiB (2%)
    Language                       : English
    Default                        : Yes
    Forced                         : No
    You can see the differences in how MediaInfo reports the video stream.
    And the OS obviously reports the files as different in size as well.
    I would assume that the decreased file size is because the MKV container is more efficient than the MP4 container, but if that's the case then why does MediaInfo report difference in the video streams bitrate?

    I uploaded the source MP4 to mu Dropbox if anyone else want's to try this on their system:
    Code:
    https://www.dropbox.com/s/lnoh101ej1zkfj9/testfile.mp4?dl=0
    Quote Quote  
  2. I'm a Super Moderator johns0's Avatar
    Join Date
    Jun 2002
    Location
    canada
    Search Comp PM
    Moved your post to a new thread so people didn't to read older post.
    I think,therefore i am a hamster.
    Quote Quote  
  3. The difference is not because of mkv being inherently more efficient than mp4 but because mkvmerge removes H.264 filler data (NALU type 12) present in the stream. In this case you can see it in the info from MediaInfo/x264 custom SEI:
    Writing library : x264 core 148
    Encoding settings : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=8 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / paff=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=0 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=cbr / mbtree=1 / bitrate=8000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=8000 / vbv_bufsize=1400 / nal_hrd=cbr / filler=1 / ip_ratio=1.40 / aq=1:1.00
    Those fillers aren't holding any information but are only to ensure a constant bitrate. You can get a similar sized mp4 by using ffmpeg's "filter_units" bitstream filter:
    Code:
    ffmpeg -i "input.mp4" -map 0 -c copy -bsf:v filter_units=remove_types=12 "output.mp4"
    Quote Quote  
  4. Thanks for the quick reply.
    Is there a way to have mkvmerge not remove the filler (not that I necessarily want a larger file, but just curious)?
    Quote Quote  
  5. AFAIK: no, there is not.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!