Jump to content

Codecs - Best Practices


Prowler8735

Recommended Posts

Prowler8735

Hi there,

my goal is to avoid to transcode any movies and to make the playback as smooth as possible, while retaining high quality. This is why I would like to transcode all my media, by using Tdarr and converting them (with ffmpeg) to an appropriate format.

I am still struggling with understanding, which codecs/containers are supported and which have to be transcoded. Even though I came across other threads talking about it, the best I could find was the hint on the FAQ answering most, but not all questions: https://support.emby.media/support/solutions/44000610499

If you take a look at the article for Emby Theater for Windows, they basically say "a lot of codecs are supported". I just tested it with a HEVC codec in a MP4 container. The video gets transcoded into x264 and the MP4 gets converted into HLS.

So, is there a possibility to answer this question once and for all?

What codecs are supported per client? What containers should we use?

What are best practices in terms of keyframes and all other parameters someone could use with ffmpeg?

Link to comment
Share on other sites

42 minutes ago, Prowler8735 said:

Hi there,

my goal is to avoid to transcode any movies and to make the playback as smooth as possible, while retaining high quality. This is why I would like to transcode all my media, by using Tdarr and converting them (with ffmpeg) to an appropriate format.

I am still struggling with understanding, which codecs/containers are supported and which have to be transcoded. Even though I came across other threads talking about it, the best I could find was the hint on the FAQ answering most, but not all questions: https://support.emby.media/support/solutions/44000610499

If you take a look at the article for Emby Theater for Windows, they basically say "a lot of codecs are supported". I just tested it with a HEVC codec in a MP4 container. The video gets transcoded into x264 and the MP4 gets converted into HLS.

So, is there a possibility to answer this question once and for all?

What codecs are supported per client? What containers should we use?

What are best practices in terms of keyframes and all other parameters someone could use with ffmpeg?

Hi, it really depends on the device you're playing with, and what it supports. Try the downloaded Emby Theater desktop app instead of the store app.

https://emby.media/emby-theater.html

Link to comment
Share on other sites

Prowler8735
12 hours ago, Luke said:

Hi, it really depends on the device you're playing with, and what it supports. Try the downloaded Emby Theater desktop app instead of the store app.

https://emby.media/emby-theater.html

Thanks Luke, but that's not really a reply I'm happy with. Up until now there is no true documentation about what client is able to play what codec.

Also, why are there two different "Emby Theater for Windows" apps, with different capabilities? This does absolutely make no sense and is very confusing for users.

Again, I ask you guys to improve documentation about the capabilities of each client and what the best practices are to have the best home theater experience possible. Thank you.

  • Agree 1
Link to comment
Share on other sites

Happy2Play
11 minutes ago, Prowler8735 said:

Also, why are there two different "Emby Theater for Windows" apps, with different capabilities?

Players as Desktop version uses MPV.

If your system supports HEVC then the Store version will Direct play as my Windows does.  But Desktop version does play better.

In the end whatever the device supports will Direct play, now remote connections will have a bandwidth variable and Auto will/can be conservative.  But the majority of transcoding comes from subtitles from what I have seen.

Link to comment
Share on other sites

justinrh

Isn't x264 in a MP4 container the most universal?  That's what I've standardized on when I do convert videos.  Otherwise, I let my Shield direct play whatever the file is.  I don't get too worried about possible audio transcoding since it does not overload my not-so-powerful server.

I think you need to determine your 90% use case (device + app), then that should tell you the codecs to use.

  • Agree 1
Link to comment
Share on other sites

rbjtech

h264 with aac 2.0 audio in a MKV container is about the most compatible codec/container.

Possibly the mp4 container if you have an Apple eco system.

Link to comment
Share on other sites

visproduction

Emby for Web browsers: mp4 x.264 with AAC audio works for all browsers I've tested.

  1. I believe mkv container plays back only with Safari, some older Edge browsers.  On Chrome, Firefox, Opera and other similar browsers mkv will not play, unless you have installed a mkv playback plug in.
  2. If you have video x.264 and audio AAC in a .mkv container, you can usually rename the file to .mp4 to playback on Chrome, Firefox and similar browsers, but only embedded ASS subtitles will work.  If there are any other embedded subtitles and the user selects a subtitle  on the web Emby media page, the video will not play and you get the warning pop-up.  Seperate file SRT subtitles will show up and work correctly if the file is named correctly. [media title of each mp4 video].en.srt or fr.srt, de.srt, es.srt... etc.
  3. Using a media encoder and saving the media, set to just copy both video x.264 and AAC audio media, but change the container from .mkv to .mp4, can fix the subtitle problem.  Software like AVIDemux, allows you to also add language designation (audio pull down tab).  When the media is copied from .mkv to mk4 container, all embedded subtitles are removed because this is the built-in policy from AVIDemux.  The new .mp4 copy fixes embedded playback subtitles by just removing them completly. 
  4. For some reason MKVToolsNix doesn't fix the subtitles to not show on the Emby web media page, even if you load a media file and use MKVToolsNix  header editor to turn off, make non-default and non-active subtitles.  The Emby player still seems to pick up some remaining header data and show the subtitles as pull down options in the media page.  I don't use MKVToolsNix to clean up embedded subtitles inside a mkv container. If the video is x.264 (mp4) but the container is mkv, then using AVIDemux to save the whole media file with just copy video and copy audio and change the container to mp4 removes Emby media page subtitles pull down list.  I think this is called remuxing and it's very fast, usually only takes 2 minutes for a 2 hour movie.  The user on the Emby media page no longer can get stuck with cannot play this file pop-up after selecting an embedded subtitle that doesn't work   The AVIDemux step takes away the Emby media embedded subtitles for that copied media file, but will still show any separate, working SRT subtitle file.

    I prefer to prepare all my media to playback on any browser for any user without having the user download a mkv plugin or install Emby Theater.  I make all media into x264 and AAC audio (stereo to 5.1 surround) and do not use any HDR video or dolby 7.1 or DTS.  I know there are bandwidth and file size reasons to use x.265 HEVC video.  I don't use x.265, so that all browsers for any user will work.   With x.264 and AAC audio I can turn off transcoding completely. 

    For non-transcoding local server media playback, x264 works well, even with 4K, non HDR files.  The media just takes up maybe 40% more room than x.265 for a similar quality look. mp4 quality keeps most 2 hour content media at my preferred quality at 1080P resolution using 2100 - 2400 kbps video set to very high quality, slow conversion setting, which is different from transcoding that needs to happen much faster and uses higher bitrates.  To get to this quality and file size on a typical standard Core 7 computer without special video cards, the encoding time is about 4 to 6 hours per 2 hour media.  That's an important factor to consider. A souped up encoder / server can go much faster.  Quality look on mp4 stored media allows reasonable size file for storage and transfer bandwidth per media is also smaller than most transcoding which needs to use higher bitrates to look good.

I hope all that makes some sense and helps.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...