As global demand for high-quality, flexible video streaming continues to grow, expected to reach $606.77 billion by 2032, the need to understand and apply transmuxing and transcoding effectively is critical. These two processes may seem similar, but they have distinct roles within video streaming workflows. Transmuxing is focused on reformatting containers without changing underlying data, while transcoding re-encodes content to adjust bitrate, resolution, or codec, enabling more adaptable playback experiences.
In this blog, we’ll explore transmuxing and transcoding, highlighting specific use cases, relevant performance metrics, practical applications, and industry data to help guide your choices.
Transmuxing, or transformation of multiplexing, changes a video’s container format without modifying the underlying audio and video codecs. Containers, such as MP4, MKV, or HLS, act as wrappers around the media streams.
Transmuxing simply shifts content into a new container, making it a fast, low-resource solution when no quality loss or additional encoding is required. This approach is particularly useful for live streaming where low latency and real-time delivery are crucial.
In live streaming, latency reduction directly impacts viewer retention. Studies show that viewers start to abandon a video if it takes more than 2 seconds to start up, with each incremental delay of 1 second resulting in a 5.8% increase in the abandonment rate. Transmuxing is perfect for live events as it repackages video without re-encoding, making the stream instantly adaptable to protocols like HLS or DASH. For instance, if your live feed is encoded in a compatible format, transmuxing allows it to be repackaged into an HLS stream for Apple TV devices within milliseconds.
Transmuxing metrics and performance indicators:
To repack an MP4 video into HLS format without changing codecs, use the following FFmpeg command:
ffmpeg -i input.mp4 -c copy -hls_time 6 -hls_list_size 0 -f hls output.m3u8
Key parameters:
Codec limitations: Since codecs are not altered, transmuxing doesn’t address compatibility issues for unsupported codecs on specific devices.
Transcoding, on the other hand, involves re-encoding video and audio data to a different codec, bitrate, or resolution. This process is vital for delivering content across a broad range of devices and adapting to diverse network conditions. Transcoding is essential for adaptive bitrate (ABR) streaming, which dynamically adjusts video quality based on network conditions to ensure seamless playback.
Industry use case: Adaptive bitrate streaming (ABR)
ABR streaming has become an industry standard due to its impact on user experience 78% of viewers abandon videos that buffer frequently. In ABR, multiple versions of the same video are encoded at different bitrates and resolutions (e.g., 1080p, 720p, 480p). The player dynamically selects the optimal stream based on network and device conditions, helping reduce buffering and enhance viewer satisfaction. For example, Netflix encodes popular shows in five to eight different bitrates for ABR streaming, allowing users to switch seamlessly depending on their bandwidth.
To convert a 4K HEVC video to Full HD H.264 for broad compatibility, you can use:
ffmpeg -i input_4k_hevc.mp4 -c:v libx264 -preset slow -crf 23 -c:a aac -b:a 128k -vf "scale=1920:1080" -b:v 5000k output_1080p_h264.mp4
Parameters:
When integrating transmuxing or transcoding, consider:
FastPix provides both transcoding and transmuxing for the user, so that the user doesn’t need to worry about the complication’s underneath. The user can upload a media file by URL or from the device. The playback ID is provided in response for the user to stream the media content.
The output provided by FastPix is in the CMAF format which helps in reducing storage, easy DRM integration and provide low latency streaming for most of the devices.
The media is transcoded and transmuxed to support ABR streaming and adapt to the desired protocol. This helps in smooth streaming in any network condition. Integrating with FastPix is easy and one of the examples of how to create a media from URL for on-demand streaming is mentioned below:
1POST https://v1.fastpix.io/on-demand
2{
3 "inputs": [
4 {
5 "type": "video",
6 "url": "https://static.fastpix.io/sample.mp4"
7 }
8 ],
9 "metadata": {
10 "key1": "value1"
11 },
12 "accessPolicy": "public",
13 "maxResolution": "1080p"
14}
15
1{
2 "success": true,
3 "data": {
4 "id": "2104b7a9-549e-4c8e-a0db-efe48433db83",
5 "trial": false,
6 "status": "created",
7 "createdAt": "2024-10-30T07:00:42.089421Z",
8 "updatedAt": "2024-10-30T07:00:42.089425Z",
9 "playbackIds": [
10 {
11 "id": "06345401-5654-4136-b3bf-a832cbae72cc",
12 "accessPolicy": "public"
13 }
14 ],
15 "metadata": {
16 "key1": "value1"
17 },
18 "maxResolution": "1080p"
19 }
20}
21
As we can see in the above response example the playback ID can be used for streaming the on-demand content using the URL stream.fastpix.io/{playbackID}.m3u8.
Transmuxing provides fast, efficient protocol adaptation, ideal for real-time streaming. Transcoding, on the other hand, enables high adaptability, essential for ABR streaming and device compatibility. As video continues to dominate online content, implementing these techniques effectively will boost streaming quality, reduce costs, and improve viewer satisfaction.
To find out how video is made easy with our APIs, create your free account and sign up today!
Many video platforms, like YouTube, Netflix leverage these techniques to optimize streaming quality and user experience. For instance, FastPix employs sophisticated transcoding strategies to deliver adaptive bitrate streaming, ensuring seamless playback across varying network conditions and devices.
The costs can vary significantly based on the cloud provider and the resources used. For example, transcoding typically requires more CPU and memory, leading to higher operational costs, especially when processing high-resolution content. A detailed cost analysis comparing providers can help determine the most budget-friendly option for your needs.
It’s essential to benchmark processing times, CPU/GPU usage, and memory consumption for both processes. Running tests with tools like FFmpeg can provide insights into how long it takes to process different resolutions (e.g., 1080p vs. 4K) and help you gauge the efficiency of your streaming workflow.
Research indicates that streaming quality can significantly impact viewer retention. For example, a delay of just a few seconds can lead to substantial viewer drop-off, particularly in live sports streaming. Ensuring low latency through techniques like transmuxing can help keep audiences engaged.
Yes, different content types have distinct requirements. For instance, live sports often benefit from transmuxing to minimize latency, while on-demand content may require transcoding to ensure compatibility across various devices and network conditions.
Consider factors such as bandwidth limitations, device compatibility, storage capacity, and budget. For example, use transmuxing when existing codecs are compatible and you need rapid repackaging, while opting for transcoding when targeting a wider range of devices or optimizing for network conditions.
Keep an eye on emerging codecs (such as AV1 and VVC) and evolving streaming standards like CMAF. Understanding how these advancements will impact transmuxing and transcoding can help you stay ahead in the rapidly changing video streaming landscape.