MediaArea / MediaInfo

Convenient unified display of the most relevant technical and tag data for video and audio files.
https://MediaArea.net/MediaInfo
BSD 2-Clause "Simplified" License
1.33k stars 161 forks source link

Bit rate confusion #323

Closed gtkpr closed 4 years ago

gtkpr commented 5 years ago

I can't find any information anywhere else, so I'm posting this here.

I'm comparing duplicate media files using MediaInfo, so that I can keep the one with the best quality and delete the other one. However, I'm confused by some of the information.

One Duplicate https://i.postimg.cc/y6t5vMcY/bitrate.png Another Duplicate https://i.postimg.cc/wjcGx3P7/bitrate2.png

Of course Overall bit rate mode: Variable means that the bit rate varies throughout the file or playback.

But what does Overall bit rate mean? Is this the average?

If so, how can the Maximum Overall bit rate be lower than the average?

There's even more discrepancies when you start looking at all of the bit rate properties listed under the Video branch or title.

This issue is prevalent for many of my duplicate files and I'd really love to free up some storage space.

Any help would be greatly appreciated.

JeromeMartinez commented 5 years ago

But what does Overall bit rate mean? Is this the average?

Average bit rare of the whole file (all streams + container overhead)

If so, how can the Maximum Overall bit rate be lower than the average?

The maximum is a container metadata so ever the calculation of overall bit rate is wrong or the metadata is wrong.

so that I can keep the one with the best quality [...] I'd really love to free up some storage space.

Looks like you consider that keeping the file with highest bit rate is a good method for selecting by quality, this assumption is wrong. And for freeing space, it is best to choose the best quality/bitrate rather then highest quality at any bitrate (and no, this is not easy to do it automaticaly as the quality also depends on the source)

Note: it is a copy of my reply on SuperUSer.

liweijian commented 4 years ago

Since this issue is still in open status, I've like to share my confusion on bitrate definition: What the relationship among Overall bit rate , Bit rate (Video), Bit rate(Audio).

For example, the Overall bit rate is 3 118 kb/s, Bit rate(Video) is 3 020 kb/s, Bit rate(Audio) is 96.0 kb/s.

It seems that 3118 is not equal to 3020+96, just wondering what's the different?

$ mediainfo fast.mp4
General
Complete name                            : fast.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/iso2/avc1/mp41)
File size                                : 13.1 MiB
Duration                                 : 35 s 177 ms
Overall bit rate                         : 3 118 kb/s
Writing application                      : Lavf57.83.100
Comment                                  : GIFSHOW [57593481][Xiaomi|MI 9][10|29][cepheus][7.5.10.14246][EditorVer:fullScreen3][-1:0.0][pipeline]#[1920x1080][60.00fps][10685k][175k][T][7][tv=95ac_0121][audioCmpGain=1.3457][eqMode=0][audioGain=1.0732][p=/oFhCoVCwYZYGWTm6KP1qw==]

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L3.2
Format settings                          : CABAC / 4 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 4 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 35 s 100 ms
Bit rate                                 : 3 020 kb/s
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 60.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.055
Stream size                              : 12.6 MiB (97%)
Writing library                          : x264 core 148
Color range                              : Limited
Color primaries                          : BT.601 PAL
Transfer characteristics                 : BT.601
Matrix coefficients                      : BT.601
Codec configuration box                  : avcC

Audio
ID                                       : 2
Format                                   : AAC LC SBR
Format/Info                              : Advanced Audio Codec Low Complexity with Spectral Band Replication
Commercial name                          : HE-AAC
Format settings                          : NBC
Codec ID                                 : mp4a-40-5
Duration                                 : 35 s 177 ms
Duration_LastFrame                       : -25 ms
Bit rate mode                            : Constant
Bit rate                                 : 96.0 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 44.1 kHz
Frame rate                               : 21.533 FPS (2048 SPF)
Compression mode                         : Lossy
Stream size                              : 412 KiB (3%)
Default                                  : Yes
Alternate group                          : 1
JeromeMartinez commented 4 years ago

What the relationship among Overall bit rate , Bit rate (Video), Bit rate(Audio).

Overall bit rate = sum of bit rate of all tracks + overhead of container. (already indicated in my reply on SuperUSer)

It seems that 3118 is not equal to 3020+96, just wondering what's the different?

3118 - (3020 + 96) = 2 kbps of container overhead (more or less due to rounding)

You can get the exact size of tracks and container overhead when you check "Debug", "Advanced view" menu.

liweijian commented 4 years ago

Awesome thanks @JeromeMartinez , I believe that we might close this issue right now and add some FAQ in the Readme on this specific issue if it is necessary.