How does ffmpeg determine individual stream bitrates

bitrateffmpegvideo

For example, I have a video for which ffmpeg shows

  Duration: 00:46:43.72, start: 0.540000, bitrate: 2593 kb/s
    Stream #0.0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x576 [PAR 16:15 DAR 4:3], 9000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0.1[0x80]: Audio: ac3, 48000 Hz, stereo, s16, 448 kb/s

The size of the file is 908843008 bytes, so the 2593 kb/s is correct. But why does it say that the video stream bitrate is 9000 kb/s?

Best Answer

MPEG streams typically use variable bitrate encoding in order to save space in sections of the video that are easy to encode, thus allow increased quality. FFMpeg is reporting the bitrate stored in the video stream's sequence header, which is the maximum bitrate in the entire file (or, in many cases, the maximum bitrate the encoder was configured to allow -- the actual file may not have any sections that use as high a bitrate as this). The value 9000kbps is typical of MPEG2 streams from (or destined for) DVDs: DVDs have a maximum combined video & audio bitrate of 9800kbps, so this allows ~500kbps for audio and some spare for navigation packets & other overhead.

Related Question