What is transcoding?

A Blu-ray disk contains video chapters and their corresponding audio tracks. the video is generally in h.264 format (think of that as a word document in .docx format). the audio is generally in Dolby digital or DTS formats (think of that as .flac or .mp3).

To get that data off of the disk, you need a way for shit to play it back and a way for those 2 files (the chapter and its audio) to be held together. This is where formats like .mp4 and .mkv come in. Think of those as .7z or .zip or .rar.

Now, if you dump the Blu-ray disk’s audio/video track into .mkv without touching it (ie without attempting to make it any smaller) you’ll have a very large .mkv file (20-40gb in size, depending on if it came from a single or dual layer blu ray disk).

That’s the basic setup we’re working with to answer question on transcoding.

So now there are a number of scenarios. maybe you have a computer in the same house on the same network and that computer can play back anything and everything, because its a computer and the software was designed for it. Plex will simply send the raw file over the network and the player will decode it and play it back.

lets say you’re using something special on your home network like a mobile phone or appleTV or chromecast or something. Those devices are only built to play back certain file formats (the .docx and .flac we spoke of earlier) and they can only read those formats from certain containers (.mkv and .mp4).

In this scenario, plex will do its best to not touch anything possible. but it might need to change it from .mkv to .mp4 or vice versa. it might be forced to do this if you enable subtitles. this takes practically 0 processing power and it will not affect the quality in any way.

lets say you took your video and wanted to make it smaller so you used HEVC (h.265) to re-encode it. This is a lossy encode and is very difficult to encode/decode quickly so a lot of hardware currently doesnt support it. but the resulting file size is tiny in comparison (half or less). but now your appleTV and mobile phone wont play it back because it doesnt know what the heck h.265 is. Now plex will convert on-the-fly to h.264 (this is transcoding) and also change the contianer (also transcoding) in order for the file to be of the appropriate file type for you to be able to play back.

Lets say you have friends and family on varying internet connections/speeds, with varying devices, and you yourself only have limited upload speeds available to you because fuck telecom industry and fuck the FCC.

Now plex can be told to limit bandwidth usage and limit CPU usage for transcoding tasks and limit transcode quality so that you are able to send that file to many people at the same time without completely locking down your computer or your network.

You can also tell plex to store multiple copies of 1 file in different formats so that you dont have to transcode on-the-fly. This would be especially useful for massive files that you can convert slowly to very high quality and keep laying around, so that when a user asks for the file, they are simply sent the file without your CPU and GPU going crazy.

In laymans terms for the most part you dont really need to worry about it. But realistically, you’ll run into weird boundary cases in which some people are not able to play things back properly (stuttering/buffering/freezing) and then you’ll need to understand what is happening under the hood in order to take steps to fix the underlying issue or make smart decisions about when/where to invest money into the setup.

You can read more here.

FavoriteLoadingAdd to favorites
Spread the love

Author: Shahzad Khan

Software developer / Architect