Bitrate
lastmod 2022-07-13created 2015-02-2525 edits
In telecommunications and computing, bitrate is the number of bits processed per unit of time (for example, per second).
Bitrate is calculated using bits per second (bit/s or bps). SI prefixes such as kilo, mega, giga, and tera are attached to it.
Bitrate formulas
The relationship between size and bitrate is:
- Size (byte) = Bitrate (bps) * playback time (seconds) / 8 (convert to bytes)
- Bitrate (bps) = Size (byte) / playback time (seconds) * 8 (convert to bits)
The Bit Rate of Video and Audio is
- Video bit rate = (width x height) * fps * bits per pixel
- Audio bit rate = sample rate * bit depth * audio channel count
Examples
The Bitrate of a 30fps Full HD video sampled at 8bit is:
| WARNING |
| Note that "bits per pixel" for video does not mean something like the 24bit of RGB888, but quantized bits (Quantized bits). The example above used 8bit to aid understanding, but you should use quantized bits (Quantized bits). Just look at the #Video (MPEG1 or MPEG2) section: Blu-ray Disc quality is 50Mbps, while the value calculated above is a whopping 497Mbps. Far too high. |
The Bitrate of 2ch stereo, 16bit, 48KHz audio is:
Making the video bitrate example more realistic and easier to understand
A single 26-minute anime episode from an Ohys release takes up 250MByte. You can tell just from the file name.
Let's check the Audio/Audio information.
- Duration: 26 minutes 1 second
- Video
- Dimension: 1280 × 720
- Codec: H.264 (High Profile)
- Frame rate: 23.98 frames per second
- Bit rate: 1110 kbps
- Codec: MPEG-4 AAC
- Channels: Stereo
- Sample rate: 48000 Hz
- Bit rate: 173 kbps
The audio size is:
Subtracting the audio size from the file size (ignoring header size and the like) gives the video size:
Let's work back to the video bitrate:
Bitrate (bps) = 용량 (byte) / 재생 시간 (초) * 8 (bit로 변환)
Bitrate (bps) = 228,409,000 / (25*60) * 8
Bitrate (bps) = 약 1,218,181 bps
Note that since it is 24fps,
Video bit rate = (width x height) * fps * bits per pixel
bits per pixel = Video bit rate / (width x height) / fps
bits per pixel = Video bit rate / (width x height) / fps
bits per pixel = 1,218,181 bps / (1280 x 720) / 24fps
bits per pixel = 0.05507
In short, this means an Ohys release has a "bits per pixel" of about 0.05507. Looking at the #Quantized bits table, it falls (when rounded) under the "lowest quality allowed by twitch" item.
As an FFmpeg command:
ffmpeg -i input.mp4 -acodec aac -ac 2 -ab 192k -vcodec libx264 -profile:v high -b:v 1150k output.mp4
Quantized bits
Sample "bits per pixel" values used when calculating video Bitrate:
- 0.06 (lowest quality allowed by twitch)
- 0.08 (the bitratecalc "low" quality approximately)
- 0.1 (recommended by twitch - the sweet spot)
- 0.15 (the bitratecalc "high" quality exactly)
- 0.16 (highest quality allowed by twitch)
Video (MPEG1 or MPEG2)
- 16 k/bps - video call quality
- 128~384 k/bps - business-oriented video conferencing system quality
- 1150 k/bps - VCD MPEG1, Video CD Standard quality
- e.g. Ohys release
Audio
- 32 k/bps - AM quality
- 96 k/bps - FM quality
- 192 k/bps - DAB (digital audio broadcasting) quality
- e.g. Ohys release
Trivia
To give a practical sense of how fast these units are:
- When downloading a file, it is hard to exceed 10 MB/s no matter how fast the server is.
- When encoding a video file, the file size is bitrate * playback time. In other words, the higher the bitrate, the larger the file.
- For audio files, mono is usually set to 128Kbps.
- To upload a 1080p video to YouTube, you need to set the bitrate to around 8Mbps to 15Mbps.#
- For a 1080p, 60fps internet broadcast to go out at proper quality, a bitrate of at least 5000Kbps (5Mbps) must be guaranteed. High-quality broadcasts usually need at least 7000~8000 Kbps (7~8 Mbps) to stream properly without the picture breaking up into blocks (the so-called blocking artifacts). However, as of 2018, few broadcasts can stream at this quality, and broadcasting platforms only provide such a streaming environment to some broadcasts with many viewers. If an ordinary internet broadcaster streams with these settings, it will very likely buffer. In that case, giving up either 1080p or 60 frames and lowering the bitrate to around 5000~6000 Kbps (5~6 Mbps) lets you stream reasonably smoothly.
Youtube recommended upload encoding settings
See YouTube#Recommended upload encoding settings.
See also
Favorite site
- Wikipedia (en) Description of bitrate
- What is bitrate (BitRate) in video/audio
- Appropriate bitrate by video resolution (bit per second)
- Calculating BitRate 1
References
-
Blog.naver.com_-limsaid-_calculate_BitRate.pdf ↩