Did you know? All Video & Audio API plans include a $100 free usage credit each month so you can build and test risk-free. View Plans ->

Transcoding vs. Encoding

Encoding and transcoding are both essential to the media streaming workflow, but that doesn't stop them from being easily confused with each other.

This glossary page breaks down the differences between transcoding and encoding and explores their roles in app development and video and audio streaming platforms.

What Is Transcoding vs Encoding?

Transcoding and encoding both change video and audio from one digital format to another, but they work differently and at different stages in a streaming workflow.

Encoding compresses raw video and audio data to make it easier to store, transfer, and stream.

When a streamer broadcasts to a live audience, their camera and mic capture their raw video and sound while hardware or software encodes it into a compatible, compressed format. This enables a wider audience to view the live stream.

Transcoding transforms already encoded media into different formats for compatibility.

The streamer or, more likely, the platform on which they stream transcodes their content --- decompresses and recompresses it in different forms. This allows more users to view video content across a wider variety of platforms and internet connection speeds.

How Do Transcoding and Encoding Work?

Video and audio are at their highest quality in uncompressed formats, but working with uncompressed digital media files is impractical in most situations. They have much larger file sizes, and the required bandwidth to stream or transfer them is in the several gigabits per second range. This excludes most consumers without high-end internet connections while costing companies a fortune to store and stream.

The encoding process compresses sound and footage with audio and video codecs to produce smaller files, enabling live streams and video-on-demand (VOD) services to reach larger audiences.

Codecs employ algorithms to decide what aspects of video or audio to discard during compression.

Codecs also decode video and audio files for playback on user devices. The combination of encoding for storage and transfer and decoding for consumption is where common codecs (coder-decoders) get their name.

During compression, audio and video quality will drop to varying degrees depending on factors like the codec used and the live stream or file's bitrate.

Generally speaking, as quality goes up, so do file size and bandwidth requirements for streaming --- and the number of viewers able to watch the content goes down.

An edtech company might record a speaker's presentation at a conference and encode it with the H.265/HEVC video codec as a fragmented .mp4 at 4K resolution with 60 frames per second (FPS) and a 40 Mbps bitrate.

This would produce a high-quality video at the cost of losing viewers with slower connections, smaller screens or resolutions, and legacy devices that may not support the file container or the H.265 codec.

This is why having just one encoded livestream or media file isn't enough.

Companies need multiple versions of their content to reach as many users as possible. Some consumers might watch 4K video content on new TVs or high-end computer monitors, but others use older laptops or smaller playback devices like tablets and phones.

Video transcoding allows you to reach more viewers by decompressing an encoded file and re-encoding it in a different file format, file container, video resolution, bitrate, bitrate control method, file size, and/or with a different codec.

The video team at the edtech company can load the .mp4 file into their preferred transcoding software and change any of the settings mentioned above. They can create multiple copies at 1080p, 720p, 480p, and other resolutions to accommodate more screens. They could also transcode additional copies with different bitrates, using other common video codecs like H.264 or in different containers like .ts or .mkv.

What Do Transcoding and Encoding Look Like in App Development?

How developers work with encoding and transcoding varies on the use case. Let's examine two implementations where developers deal with both.

VOD

When building a VOD service like Netflix, you need to create a workflow that delivers excellent picture and audio quality to as many viewers as possible.

When encoding the original file, it's important to balance the highest quality your budget will allow while considering storage, licensing, cloud services, and other costs. Companies with bigger budgets can use DNxHR or ProRes codecs to produce files in 4k at 60FPS with 10-bit or 12-bit color.

With smaller VOD setups, your team might handle encoding and transcoding using tools like HandBrake or FFmpeg. For large-scale implementations, you might utilize cloud services like AWS or Azure Media Services.

The file containers you choose must be compatible with your chosen streaming protocol(s) and target audience's devices. To this end, you might use fragmented .mp4s encoded and delivered with the Common Media Application Framework (CMAF), which accommodates Apple devices with HTTP Live Streaming (HLS) and Microsoft, Android, and other devices with MPEG-DASH.

Livestreaming

If you're working on a livestreaming site or app like Twitch, you need to balance quality and audience reach with low latency, especially for sports matches, virtual classrooms, or other live events.

For user-created content platforms, encoding usually happens on the broadcaster's end. For streams run by a company or organization, like a national park's live stream of its trail cameras, an in-house team would do the encoding.

Either way, live encoding is possible with hardware encoders like an ATEM Mini Pro, software like Open Broadcaster Software (OBS), or the broadcaster's mobile device.

If you allow users to broadcast on your app, you should provide optimal encoding guidelines to simplify the transcoding process on your end.

When working with streaming protocols like HLS or MPEG-DASH, your transcoding setup will likely use cloud services like those described above.

However, if you're using WebRTC for lower latency, transcoding might be a bad idea because factors like its computational demands increase latency. Instead, you can offer streams with different qualities and bitrates by using a Selective Forwarding Unit (SFU) with Simulcast or the Scalable Video Coding (SVC) extension for H.264.

Frequently Asked Questions

Why Do I Need to Transcode If I’ve Already Encoded My Video?

Transcoding is the process of converting media files into different formats, containers, bitrates, video resolutions, file sizes, and codecs. If you only encode a file, it’s available in one form that won’t work with every viewer’s device or network. To reach a wider audience, you must transcode to accommodate them.

Can One Tool or Service Handle Both Transcoding and Encoding?

Yes, some hardware and software can handle both transcoding and encoding. FFmpeg, HandBrake, and Adobe Media Encoder are three examples of software capable of both. For hardware, ATEM Mini Pro, Teradek VidiU Go, and EzeCaster Pro can encode and transcode.

Can You Transcode Without Encoding First?

No, you cannot transcode an audio or video file without encoding it first. Just like you cannot translate a book from English to Spanish before finishing the English version, you cannot transcode an H.265 video to H.264 without the initial process of encoding.

Is One More Resource Intensive Than the Other?

Transcoding involves both decoding and re-encoding, so it is more resource-intensive than encoding.

Can You Improve Video Quality by Transcoding an Already Encoded File?

No, you can’t improve video quality by transcoding a file.

When videos are encoded, the compression process causes flaws like artifacts or color loss. If a video is transcoded to another format, it is decompressed but still retains the flaws caused by the first act of compression. When it’s re-encoded, it will have new flaws.

With each new transcoding act, the file loses quality. This is why you should hold onto the original video file for transcoding purposes.