Media Optimization - Quality of conversion

Currently we have no control over the quality or sizing of the converted media. The results we get are no better than if we just transcoded the files in real-time (assuming you have the free CPU resources). A converted 4Mbps 720P file from a 12Mbps 1080P file could end up using more storage than the original. This isn’t a problem when doing real-time transcodes but isn’t ideal when pre-converting.

What I would like to proprose is to allow us to choose a x264 preset and CRF setting during a job setup.
Ideally for Optimize if the Job Setup/edit screen allowes us to pick the profile (ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow) from a drop down (didn’t include placebo here as it’s not worth adding) and ALSO allow us to pick the CRF or Constant Rate Factor from a drop down with sane values such as 18 to 28 as choices then this is all that should be needed. This would then allow each system op to setup each job based on fast encoding speed or best compression for their system based on there needs.

With just these two additions (which should be rather simple) to the job setup we could easily allow the command line options such as “-preset slow -crf 20” to be handed off to the transcoder to get the results needed.

We would then have some real freedom in setting up our jobs to meet our individual needs.
If you like this idea please “Like” this first post!

Carlo

I approve (Liked) this. I would actually go one small step further and would like to have a “Encoder Presets” directory into which I can place simple txt files. The file name of a txt file is used as the encoding preset name and the settings to be used for the encoder are stored in the txt file itself with one setting per line (or all in one line, just like command line options).

SysOps then could predefine preferred settings, store them in files (and never forget the settings) and simply chose them from a dropdown list in the Optimizer / Sync job setup window.

If you agree do not “Like” this post but the post directly above.

I don’t know if these need to be directly editable on the file system but having the ability to setup custom transcode profiles specific to your system and then being able to use these just like “Optimized TV” (by name) would be a nice touch for sure. I too thought about this, but didn’t want to come across with a ton of new feature requests for the new Media Optimizer when I think the most important mod would be to allow us to control the x264 Preset and CRF.

Carlo

This would be a great addition to the optimization feature

I would also like more control on what is going on with the Optimization. If they are afraid that regular users will be scared off just make an “Advanced” tab for more experienced user. I would prefer to be able to choose Bitrate instead of Quality but I presume this is an indvidual thing :slight_smile:

You can already choose the bitrate in the custom section. What you can’t control is HOW that bitrate is achieved. The profile and CRF settings would fix that.

I’d like to be able to select an audio stream, and select its transcode settings.

I’d like to customize encoder settings completely (I guess the settings for the included profiles ‘Optimized for Mobile - 1.5 Mbps 720p’ and ‘Optimized for TV - 4 Mbps 1080p’ aren’t hard-coded? I would be happy to edit/add my profiles manually by editing config files…)

Other wishes:

  • possible to set what type of audio encoding and bitrate I want
  • include all subtitles as-is (use .mkv instead of .mp4, use Direct Stream instead of Direct Play, for me Direct Play is useless since all my movies contain multiple audio streams, no need to send more than one audio stream and subtitle to a client at once), and most important: don’t ever burn-in subtitles!
  • when multiple versions exists, Direct Stream should be able to select video/audio/subtitles from all the different versions - there’s no need to include same audio encoding in 5 different versions…

@jonny80 said:
I’d like to customize encoder settings completely (I guess the settings for the included profiles ‘Optimized for Mobile - 1.5 Mbps 720p’ and ‘Optimized for TV - 4 Mbps 1080p’ aren’t hard-coded? I would be happy to edit/add my profiles manually by editing config files…)

Other wishes:

  • possible to set what type of audio encoding and bitrate I want
  • include all subtitles as-is (use .mkv instead of .mp4, use Direct Stream instead of Direct Play, for me Direct Play is useless since all my movies contain multiple audio streams, no need to send more than one audio stream and subtitle to a client at once), and most important: don’t ever burn-in subtitles!
  • when multiple versions exists, Direct Stream should be able to select video/audio/subtitles from all the different versions - there’s no need to include same audio encoding in 5 different versions…

We really don’t want to have to edit any configuration files, as the next update of PMS gets installed and we would have to re-edit the files to get those options back. Having the settings available within the Web App is paramount to being able to use the options of this feature.

The whole idea behind this feature is to create a version of the file that is the most Direct Playable for the bitrates requested from the client. Direct Play is the least CPU intensive of the three ways we can send a media stream out, and if the media is Direct Playable, there really are few bottlenecks on PMS machines to limit how many streams it’s capable of doing. The biggest real bottleneck is your internet connection’s upload speed. If you have the bandwidth to support 50 streams, then even the smallest device PMS can be installed on could, potentially support 50 streams, if the media is optimized for the requests, and the bitrates requested.

On the other hand, if the media is sent Direct Stream or Transcode, the first bottleneck now is the CPU of the PMS device and not the internet connection. 50 requests, without the CPU being able to handle those requests and they are all going to buffer. No one gets to watch the movie, so no one is happy. So, for this feature Optimize Media = Direct Play Media. Direct Stream isn’t optimized, and transcode is certainly not optimized…

How many of the languages that you have in your media are actually USED? Let’s say you have 10 different languages, are the ones used mostly English? Spanish? French? And the rest are never played? Remember, we said optimizing the media is making it the most Direct Playable format possible… Are you going to need that movie in Swahili? Would any of your users ever WANT that language streaming on their devices? If it’s never requested, why would you want it in an Optimized Version? If someone does request it, there is a prime example of when to transcode, if it’s a one-off or one in 10,000 requests made of your server.

I agree about never burning in subtitles. I have ONLY srt’s for that very reason. Most client apps for most devices don’t require transcoding the video stream to give the client srt subtitles. But I don’t want them in the media file, since MP4’s can’t handle them in the container. I don’t have any other files in any of my Plex Libraries, other than MP4’s and srt’s. The rest of the containers require too much transcoding for my environment, so my system wouldn’t be optimized for Direct Play if I included them, so I don’t include them, I delete them when I get the portions I want from them.

I don’t think Plex is going to be able to pick and choose where parts of the stream comes from. It’s all in the file it has open or it’s not. If we did it your way, and I made a request, you made a request, and 4 others made requests, that’s, what, 18 files it’s trying to remember where it’s getting what portion of whichever media it’s sending? And where it is in putting all of the 18 files into 6 streams? WHY? That’s not optimizing anything, that’s complicating an already complex situation to the absurd. If the media is optimized that would be 6 streams, basically copying the file through the network, simple, no hassles, no frills, and everyone gets the media with no buffering. Toot sweet! Optimized.

What this request is all about is making the transcode settings used to make the Optimized Versions more transparent to the users. We can set the Optimized versions to the quality and bitrate requirements our users request and produce the highest quality stream we can within the limits established. Easy to say, but maybe not so easy to do, as the settings currently used are basically the same as a standard transcode. That means it’s possible that Plex has modified the transcoder engine from ffmpeg to only produce results that it’s producing now. Needless to say, that would be less than ideal…

I like the idea and do think you should offer settings with a view on “forecasted file size”. When using mobile sync on my iPad, I choose a bitrate with no idea of how the size will be and I can’t do any estimates of how many content I could fit it post-pre-conversion.

@jonny80, @MikeG6.5 covered the response I would give pretty well. The only thing I would add is MKV is a no no as it’s not a streaming media type. You want TS or MP4 for this. MP4 is the most desirable format you can have as ALL devices support this.

@celestian02 this is pretty hard to do without running a 1st pass over your media which is wasting CPU cycles that could be used for a better purpose. Ideally if they retrofit SYNC to use the optimized versions this won’t be an issue as you can MO your files and they will already be converted and ready for transfer using SYNC and the sizes will all ready be known.

Carlo

@MikeG6.5, @cayars: I think we don’t use Plex the same way… I’ll probably never have more than 5 users at the same time. I want the best quality possible to each user. I copy my Blu-rays to disc using MakeMKV. If 5 users are transcoding at the same time, my CPU will most probably be a bottleneck (it’s an AMD Phenom II X6 1055T). Then I would want to pre-encode a couple of versions for each movie (ie. 10 Mbit and 4 Mbit or something like that) with the best quality possible (preset very_slow, 2-pass encoding), to offer good quality to my users without needing to transcode (unless they want 20 Mbit bitrate).

I don’t want a version for every possible device, two or three versions in addition to the original should be enough, of course I need to find settings that are compatible with most devices. Direct Stream uses just a little bit more CPU than Direct Play (and much less CPU power than transcoding!), and I can’t see why there should be a problem mixing video, audio and subtitle streams from different files.

I’m from Norway, and have both English and Norwegian audio tracks and subtitles, plus commentary audio tracks and commentary subtitles when they’re available on Blu-ray. Direct Stream will only send the video, audio and subtitle stream that the user selects, which sounds optimal to me compared to sending the whole file with all audio and subtitle tracks. Plex can just pick the streams from my MKV’s and present them to the clients as MP4, with just a little bit more CPU usage than sending the whole file.

You don’t really sound much different than anyone else. However:
You want to avoid having to run the video through the plex transcoder when a user is viewing. so that means direct play only if possible. If you are still relying on Direct Stream then you won’t be using the optimized versions and the transcoder will fall back to using the original.

You don’t understand how subtitles work when they aren’t in separate SRT files. What happens is Plex takes the subtitles and burns them into the video. This video is a full transcode and will nail your CPU. It’s not a remux and it’s not going to be light on the CPU.

What you need to do is pull the SRT out of the MKV into separate SRT files. Convert the MKV into a high quality MP4 and call it a day. This is what many of us do. This is proven and just works.

Now what this thread is about is taking all the ready good versions of the files and creating versions for things like cell phones/tablets etc.

@cayars. Obvisouly, that will depend on each videos complexity but an estimate would be a good start. I have seen that MO displays the total size of optimized medias which is an improvement over before. Still, I am not planning days ahead my media copies to my iPad and I often end up using Infuse instead of Plex during my trips away from home.

As for the daily syncing usage, I don’t care much about MO as I would require only a few things to be synced from now and then. At the moment, the thing I care about the most is fixing the soft-subtitle feature that has been introduced in latest builds for Mobile Sync, this would greatly improve transcoding time and make Mobile Sync usable for any subtitles users.

It sounds like most of your improvement wishes are related to SYNCing and not to Media Optimization per say.

I also would very much appreciate especially to be able to configure the audio transcoding (at least basic settings like AAC, DTS or AC-3 (maybe as well as 5.1 or 2.0). There are for example restrictions when using certain Surround-Systems - Sonos Surround loudspeaker for instance (just AC-3 for 5.1 is supported). Being able to influence these settings when conducting a media optimization would mean a lot to people with such systems…

@cayars - What are you doing about DTS and higher audio tracks? A lot of devices (I use Roku almost exclusively) do not support DTS in an MP4 file. Do you just settle for 5.1 AC3 in your MP4s and ignore anything better than that? Not trying to be argumentative, just trying to see. I use MKV almost exclusively because of this limitation and if a device need to remux to MP4, it is not that big of a deal CPU wise typically.

Well I use the scripts listed in my thread that anyone can use.
What it does in a nutshell is to analyze the video to see if it can do a remux instead of a transcode. It copies all audio tracks from the original (setting/option with the ability to only keep certain languages) BUT it creates a 2 channel AAC for audio as the first track.

It also pulls the subtitles out of the video and creates SRT for them again by language and configurable. It clears the meta info in the original file and they often have stuff in them that chokes Plex up for identification. Lastly it makes sure it has a proper Atom for streaming.

So to answer your original question in more detail. If the original file had say an AC3 and a DTS soundtrack in a language you want to keep you would end up with 3 soundtracks, AAC (2 channel), AC3 and DTS.

So this would give the Ruku hopefully everything it needs to play back in direct mode. If you happen to also have another client that can use the AC3 or DTS it’s still available and usable.

Carlo

@cayars - But many devices, especially the Roku, do not support DTS in an MP4 container, but they do support it in an MKV container. Do other clients support DTS in MP4?

I think you mean it won’t handle DTS-HD. DTS I believe works just fine.