Transcoding converts an already encoded audio or video file into a different codec or adjusts its encoding settings, such as bitrate and resolution.
In video streaming, it helps make content compatible with different devices and network conditions. For example, a platform can convert a 1080p video into 720p and 480p versions at lower bitrates, allowing viewers to select a suitable quality based on their available bandwidth.
What Is Transcoding?
Different devices and platforms support different codecs and encoding settings. Transcoding addresses these differences by converting existing media into a format or quality level that meets specific playback requirements.
For example, H.264 video can be converted to H.265, which may achieve a smaller file size at comparable visual quality, depending on the encoding settings. Videos can also be converted into lower resolutions or bitrates to support different screens and network conditions.
How Does Transcoding Work?
Transcoding typically involves three stages:
1. Decoding: The system decodes the source media into a format that can be processed.
2. Processing: It applies changes such as codec conversion, bitrate adjustment, or resolution resizing.
3. Encoding: The processed media is encoded using the target settings to generate a new output.
For streaming, the output may then be packaged into formats such as HLS or DASH.
Encoding vs. Transcoding vs. Transmuxing
These operations serve different purposes:
| Process | What It Does | Example |
|---|---|---|
| Encoding | Converts raw media into an encoded format, typically using compression. | Encoding raw video into H.264. |
| Transcoding | Converts already encoded media into another codec or set of encoding parameters. | Converting H.264 to H.265 or reducing bitrate. |
| Transmuxing | Changes the container or packaging without re-encoding audio or video. | Moving compatible H.264 video from MP4 to MPEG-TS. |
The main distinction is whether the media itself needs to be re-encoded. If only the container needs to change, transmuxing may be sufficient and avoids unnecessary re-encoding.
Types of Transcoding
Transcoding can be classified by processing time and the type of adjustment.
Real-time transcoding processes incoming media during a live broadcast. It generates output streams as the event happens, making processing speed important because delays can increase streaming latency.
Batch transcoding processes media offline before delivery. It is commonly used for VOD platforms that prepare multiple versions in advance.
Common transcoding operations include:
- Codec conversion: Changes the codec, such as converting H.264 to H.265.
- Transrating: Adjusts bitrate to balance video quality and bandwidth requirements.
- Transsizing: Changes resolution to suit different screens and playback conditions.
How Does Transcoding Support Adaptive Bitrate Streaming?
Adaptive bitrate (ABR) streaming allows players to adjust video quality according to network conditions.
Transcoding supports ABR by generating multiple renditions of the same video at different resolutions and bitrates. For example, a source video may be converted into 1080p, 720p, and 480p versions.
These renditions are packaged with playlists or manifests that tell the player which versions are available. During playback, the player selects a suitable rendition based on bandwidth and buffer conditions. It can switch to a lower bitrate when network conditions deteriorate and return to a higher quality when they improve.
In short, transcoding creates the available quality options, while the player selects between them.
Benefits of Transcoding
Transcoding provides several benefits for video delivery:
- Device compatibility: Converts media into formats supported by different devices and platforms.
- Smoother playback: Multiple bitrate versions help ABR players adapt to changing network conditions and reduce buffering.
- Bandwidth efficiency: Adjusts resolution and bitrate to match available network capacity.
- Simplified distribution: Generates multiple versions from a single source for different platforms and channels.
However, transcoding also requires computing resources. Re-encoding can affect visual quality, particularly at low bitrates or when lossy transcoding is repeated. Choosing appropriate encoding settings is therefore important.
Common Use Cases and When Transcoding Is Needed
Transcoding is commonly used in three scenarios:
- Video on Demand (VOD): Uploaded videos are converted into multiple renditions and stored before playback.
- Live streaming: Incoming streams are processed in real time to generate different resolutions and bitrates for viewers.
- Multi-platform distribution: A single source file is converted into versions that meet the encoding requirements of different websites, applications, and social platforms.
Transcoding is necessary when the source media does not meet the destination's requirements, such as codec compatibility, resolution, bitrate, or ABR support.
It is not always required, though. If the source already meets playback requirements, the platform may use transmuxing to change the container or passthrough to deliver the original media without modification.
For example, CDNetworks' published media services illustrate both batch and real-time transcoding. Media Acceleration VoD uses batch processing to prepare multiple renditions before playback, while Media Acceleration Live Broadcast supports real-time conversion of incoming streams into multiple output versions.
These are examples of how different transcoding approaches support VOD and live streaming requirements.
Conclusion
Transcoding helps streaming platforms adapt media to different codecs, resolutions, bitrates, and playback environments. It also enables ABR streaming by generating multiple quality versions for players to select from.
The right approach depends on the source media and delivery requirements. Use transcoding when the encoded media needs to change, transmuxing when only the container needs to change, and passthrough when no modification is necessary.
Top comments (0)