MediaInfoLib icon indicating copy to clipboard operation
MediaInfoLib copied to clipboard

Average Bitrate is not calculated correctly? (Seems to be rounded up)

Open jessielw opened this issue 3 years ago • 0 comments

The formula to calculate average bitrate is Bitrate = file size / (number of minutes * .0075)

I have a source file with video inside

Video
Count                                    : 380
Count of stream of this kind             : 1
Kind of stream                           : Video
Kind of stream                           : Video
Stream identifier                        : 0
StreamOrder                              : 0
ID                                       : 1
ID                                       : 1
Format                                   : AVC
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format/Url                               : http://developers.videolan.org/x264.html
Commercial name                          : AVC
Format profile                           : [email protected]
Format settings                          : CABAC / 9 Ref Frames
Format settings, CABAC                   : Yes
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 9
Format settings, Reference frames        : 9 frames
Internet media type                      : video/H264
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 6281900
Duration                                 : 1 h 44 min
Duration                                 : 1 h 44 min 41 s 900 ms
Duration                                 : 1 h 44 min
Duration                                 : 01:44:41.900
Duration                                 : 01:44:43;11
Duration                                 : 01:44:41.900 (01:44:43;11)
Bit rate                                 : 4000000
Bit rate                                 : 4 000 kb/s
Maximum bit rate                         : 7773368
Maximum bit rate                         : 7 773 kb/s
Width                                    : 1280
Width                                    : 1 280 pixels
Height                                   : 692
Height                                   : 692 pixels
Stored_Height                            : 704
Sampled_Width                            : 1280
Sampled_Height                           : 692
Pixel aspect ratio                       : 1.000
Display aspect ratio                     : 1.850
Display aspect ratio                     : 1.85:1
Rotation                                 : 0.000
Frame rate mode                          : CFR
Frame rate mode                          : Constant
Frame rate                               : 23.976
Frame rate                               : 23.976 (24000/1001) FPS
FrameRate_Num                            : 24000
FrameRate_Den                            : 1001
Frame count                              : 150615
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Chroma subsampling                       : 4:2:0
Bit depth                                : 8
Bit depth                                : 8 bits
Scan type                                : Progressive
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.188
Stream size                              : 3116440962
Stream size                              : 2.90 GiB (90%)
Stream size                              : 3 GiB
Stream size                              : 2.9 GiB
Stream size                              : 2.90 GiB
Stream size                              : 2.902 GiB
Stream size                              : 2.90 GiB (90%)
Proportion of this stream                : 0.89811
Writing library                          : x264 - core 164 r3065+9 7a0e6e8 [Mod by Patman]
Writing library                          : x264 core 164 r3065+9 7a0e6e8 [Mod by Patman]
Encoded_Library_Name                     : x264
Encoded_Library_Version                  : core 164 r3065+9 7a0e6e8 [Mod by Patman]
Encoding settings                        : cabac=1 / ref=9 / deblock=1:-2:-2 / analyse=0x3:0x113 / me=umh / subme=10 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=32 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=-2 / threads=22 / lookahead_threads=3 / sliced_threads=0 / nr=0 / decimate=0 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=8 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=2pass / mbtree=0 / bitrate=4000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=4000 / vbv_bufsize=8000 / nal_hrd=none / filler=0 / ip_ratio=1.40 / pb_ratio=1.30 / aq=3:1.00
Encoded date                             : UTC 2021-12-08 22:57:39
Tagged date                              : UTC 2021-12-08 22:58:31
colour_description_present               : Yes
colour_description_present_Source        : Container / Stream
Color range                              : Limited
colour_range_Source                      : Container / Stream
Color primaries                          : BT.709
colour_primaries_Source                  : Container / Stream
Transfer characteristics                 : BT.709
transfer_characteristics_Source          : Container / Stream
Matrix coefficients                      : BT.709
matrix_coefficients_Source               : Container / Stream
Codec configuration box                  : avcC

The bitrate shown is

Bit rate                                 : 4000000
Bit rate                                 : 4 000 kb/s

When in reality it should actually be ~3,968

Checking the information with ffprobe results in the proper calculated bitrate Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1280x692, 3968 kb/s, 23.98 fps, 23.98 tbr, 96k tbn (default)

3968 kb/s

It would be helpful for me for mediainfo to display the information without rounding up to the selected bitrate of 4000k in this case. Thanks!

jessielw avatar Jan 19 '22 22:01 jessielw