How to Avoid Transcoding

Learning how to avoid transcoding movie files from your Plex server is a common question, as it can cause issues if multiple movies are being transcoded at the same time. There are three methods that Plex Media Server will use to stream content to a device: direct play, direct stream and transcoding, and out of the three methods, transcoding is used if Plex can't find a compatible movie file to stream to a device.

Direct play is the preferred method, as it uses the least amount of resources on the server. The next best option is Direct stream because it uses less system resources. Transcoding, however, can use up to 100% of the CPU, depending on what is being transcoded, so the goal of managing a Plex server is to transcode as little as possible.

How to Avoid Transoding with Plex

While you can try to have your Plex Media Server and clients direct play as much content as possible, there may be times where that isn't possible, and transcoding happens. The reason that transcoding happens is that use many devices that can stream content from Plex, but can't play a specific movie file as it is without having Plex transcode the file. There are mobile devices, or older media playing devices, that may require content be streamed at 720p or less, and can't direct play movies that have video content that is 1080p and higher.

So with such a varied array of devices, how can you go about managing your movie files so they require less transcoding? The best way is to provide movie files that are compatible with a wide variety of devices.

Recommended movie file specifications

While different devices can play different types of movie files, there is a good specification that can be used for high-quality movies, that can play on a good number of media streaming devices.

The specification is as follows:

  • Container: mp4
  • Resolution: 1920x1080 or lower
  • Video codec: H.264 (level 4.0 or lower)
  • Framerate: 30 fps (bit depth: 8)
  • Audio Codec: AAC (2 channels)
  • Bitrate: 20 Mbps or lower

While the above specifications are good for a majority of media streaming devices, it may not be compatible with some devices - such as older, low-end, or some mobile devices. This would cause Plex to transcode the movie file, using up resources on the Plex server.

A simple solution to avoid transcoding, and have more of your media direct played, is to take a page from Netflix: provide multiple versions of your movie files. If many of your movies have similar specifications as the recommended specifications, then you have a good starting point for the next section.

Optimizing movie files

The easiest way to create multiple versions of your movie files is to have Plex create the files for you. Keep in mind that this will cause high CPU usage, so you should think about doing this when your Plex server is not being used to stream media.

To have Plex create another, optimized, version of a movie file, do the following:

  1. Open Plex from your Web browser, and ensure the user you select has access to administer the Plex instance.
  2. Select the library on the left that contains the movies that you wish to optimize. If all your movies aren't displayed, click the Library link at the top.
  3. Hover your mouse over the movie you wish to optimize, then click the three dots in the bottom left corner of the movie poster.
  4. Click the Optimise... option from the menu that appears. The Optimise dialog (shown below) is displayed on the screen. Plex Optimise Dialog
  5. Select one of the options in the dropdown list if you wish to use one of the templated profiles. They are good for quick optimizations that should work for the selected device. The list includes:
    • Optimized for Mobile (4 Mbps 720p): This profile will limit the video to 720p, and will transcode audio to AAC 2.0, if needed.
    • Optimized for TV (8 Mbps 1080p): The video will be limited to 1080p, and the audio will be transocded to AAC 2.0 or AC3.
    • Original Quality: This produces an MP4 file, with the video or audio being transcoded if either are found to be incompatible with the MP4 container.
    • Custom: This setting provides a bit more control over the file, such as device type, and bitrate. There are many options, which I won't list here, but you can use the list to determine the optimized version of the file you wish to have. The screenshot below shows the additional dropdown list that is displayed when you select the Custom option. Plex Optimise Dialog - Custom Setting
  6. Once you are satisfied with the quality options of the optimized file, you can then specify the location of the new file. I usually keep the new file in the same folder as the original, to avoid having too many files and folders everywhere on my hard drive.
  7. Once everything looks good, click the Optimise at the bottom of the dialog, and Plex will begin to create the new file. Depending on the optimization settings, it could take some time to create and new file.

After performing the above steps, Plex should then display a number in the upper-right corner of the movie post that indicates the number of versions of the movie that exists. When someone selects a movie to stream, Plex will use heuristics to determine which version of the movie to stream to the device. If one of the versions match what the device supports, then it should direct play on the device instead of transcoding the file.