Overview

Using Plex to stream to the XBox and various other devices around the home and abroad is a breeze.  While the latest Rokus and Plex clients can handle most video and audio formats, I've noticed the XBox struggles to be as universally accepting.

Tools

  • MakeMKV: Rip the BluRAY and DVDs
  • FFMPEG: Encodes video files

FFMPEG is my tool of choice because I can save the options in text files all over the place and forget where I save them then have to try and remember all the command line options to reproduce them. A lot of people use Handbrake, which I believe is a great UI tool on top of FFMPEG, but I find UIs more cumbersome than command lines.

Let's Get To It

The standard FFMPEG libx265 with no options will produce some pretty good video that, in most cases, will stream directly to the XBox.  What you really want, however, is to direct play your audio and video files so that your Plex server does not have to transcode them.

Requirements for 265 and there CLOs:

  • 10-bit Pixel format: -pix_fmt yuv420p10le
  • MKV container (you can use others, but why?): just end the output file ".mkv"
  • The codecs
    • GPU rendering is much faster but with way less options: -c:v hevc_nvenc
    • CPU rendering has all the bells and whistles, but is slower and will turn your computer into a space heater: -c:v libx265
  • You don't really need to set the desired bitrate, but if you are not happy with the quality, increase it, or try dual pass.  If you are not happy with the file size, decrease it: -b:v 2000k

That's it.  Other options should work, but be skeptical about playing with BFrames and Group of Pictures.  These options can be taxing on some media playback devices.

Now, for the audio.  There is a lot of sparsely documented support for a lot of audio formats, but I prefer AAC.  It allows me to adjust the bitrate to an acceptable file size and quality while keeping all the original channels from my video source.  Also, FFMPEG can apply filters to AAC streams if I want to change the source audio to be less obnoxious with explosions and more front loaded with dialogue.

  • Get the codec: -c:a aac
  • Do not let this warning kill a whole weekend for you "Using a PCE to encode channel layout 5.1(side)".  The XBox can not play 5.1(side): -channel_layout 5.1
  • Set the desired bitrate: -b:a 196k

See all the available (undocumented) channel layouts (LFE is the subwoofer): ffmpeg -layouts

Standard channel layouts:

  • NAME           DECOMPOSITION
  • mono           FC
  • stereo         FL+FR
  • 2.1            FL+FR+LFE
  • 3.0            FL+FR+FC
  • 3.0(back)      FL+FR+BC
  • 4.0            FL+FR+FC+BC
  • quad           FL+FR+BL+BR
  • quad(side)     FL+FR+SL+SR
  • 3.1            FL+FR+FC+LFE
  • 5.0            FL+FR+FC+BL+BR
  • 5.0(side)      FL+FR+FC+SL+SR
  • 4.1            FL+FR+FC+LFE+BC
  • 5.1            FL+FR+FC+LFE+BL+BR
  • 5.1(side)      FL+FR+FC+LFE+SL+SR
  • 6.0            FL+FR+FC+BC+SL+SR
  • 6.0(front)     FL+FR+FLC+FRC+SL+SR
  • hexagonal      FL+FR+FC+BL+BR+BC
  • 6.1            FL+FR+FC+LFE+BC+SL+SR
  • 6.1(back)      FL+FR+FC+LFE+BL+BR+BC
  • 6.1(front)     FL+FR+LFE+FLC+FRC+SL+SR
  • 7.0            FL+FR+FC+BL+BR+SL+SR
  • 7.0(front)     FL+FR+FC+FLC+FRC+SL+SR
  • 7.1            FL+FR+FC+LFE+BL+BR+SL+SR
  • 7.1(wide)      FL+FR+FC+LFE+BL+BR+FLC+FRC
  • 7.1(wide-side) FL+FR+FC+LFE+FLC+FRC+SL+SR
  • octagonal      FL+FR+FC+BL+BR+BC+SL+SR
  • hexadecagonal  FL+FR+FC+BL+BR+BC+SL+SR+TFL+TFC+TFR+TBL+TBC+TBR+WL+WR
  • downmix        DL+DR

Putting it all together

Basic ffmpeg -i movie\title_t00.mkv -c:s copy -c:a aac -c:v hevc_nvenc -b:v 2000k -b:a 196k -channel_layout 5.1 output.mkv
Strip noisy metadata ffmpeg -i movie\title_t00.mkv -c:s copy -c:a aac -c:v hevc_nvenc -b:v 2000k -b:a 196k -channel_layout 5.1 -map_metadata -1 output.mkv
Force compatible pixel format (this is mostly for 4k and bluray quality videos) ffmpeg -i movie\title_t00.mkv -c:s copy -c:a aac -c:v hevc_nvenc -b:v 2000k -b:a 196k -channel_layout 5.1 -map_metadata -1 -pix_fmt yuv420p10le output.mkv

Why 265?

Yes, the XBox 1S supports HEVC/x265.  This codec is great because of the file size and video quality.  You can look it up everywhere, the problem is that it's not fully supported everywhere.