FFMPEG parameters

Hi all, is there a log files where Plex keeps what it does with ffmpeg ? I’d like to see what parameters it uses when I do an optimization from the UI. I am having a hard time converting files manually and get the same video quality. Something I am using as parameters must be off and i’d like to compare with the one done by Plex.

So is there a log file Plex uses for ffmpeg ?

thank you

Plex Media Server.log

Search for the word: Plex Transcoder

1 Like

Although I see ressemblence with ffmpeg, I don’t recognize all parameters. Could you confirm whether Plex uses ffmpeg for manual optimizations ? Otherwise what i’m trying to do is pointless.

My issue is that if I optimize a 4k HDR file to let’s say “Universal TV” with Plex, the video looks good. It is converted to Bt.709 and the color seems ok. Now if i use ffmpeg to do the same, whenever I add a filter to convert to bt.709, the resulting video looks reddish, the colors are off.

Plex Transcoder is ffmpeg, just a special build

Check the License file located in PMS Install Dir/Resources

1 Like

Does the special build means they may have changed the command line syntax ?
thanks

In the license file, there’s a link to the source code, so you can check/build it your self

show us your ffmpeg command because it’s changed a lot in the last year.
older examples on Stack Exchange might not work.

as you probably know, it often takes very few options to get what you want from ffmpeg because of a logical set of defaults, but then it spectacularly fails for like 3 days :stuck_out_tongue:

And adding to @nibbles here…

In the PMS logs, you found the params for Plex Transcoder, so why doesn’t you simply use that, instead of a vanilla ffmpeg, since it might be missing some modules?

Edit: and by simply running Plex Trancoder in a terminal, you can see all the modules it was compiled with

Below is a cut of sample of what I mean:

nice I keep forgetting to call it directly. I sort of feel it’s slow, and my brain tells me people use Handbrake or something for batch resizing to 720p, isn’t that right?

Never tried to compare, since I run on QNAP in production…
Windows is only my test :wink:

But since my medias are on my beloved QNAP’s, I do prefer to run stuff directly on that, so I can use local file access :wink:

Edit: and a wild guess is that it’s faster, since it doesn’t have to maintain a GUI, but simply guessing here

This example is inpired from the filters used by Plex Transcoder. It Works but I get the “linear light is required to tonemap” errors. Colors seems ok but the color profile in the file remains BT.2020. If i force it with BT.709 like in the second example below, colors are off.
ffmpeg -ss 00:40:00 -t 00:00:45 -i “M:\My video 4k HDR.mkv” -map 0:v -map 0:a:1 -vf scale=1920:1080,format=p010,tonemap=mobius,format=pix_fmts=yuv420p -c:v h264_nvenc -b:v:0 8192k -c:a:0 aac -b:a:0 384k -ac 2 -metadata:s:a:0 title=“AAC 2.0” -movflags +faststart “M:\Test.mkv” -y

The following example that I’ve found online doesn’t result in right colors
ffmpeg -ss 00:40:00 -t 00:00:45 -i “M:\My video 4k HDR.mkv” -map 0:v -map 0:a:1 -vf zscale=t=linear:npl=100,format=gbrpf32le,zscale=p=bt709,tonemap=tonemap=hable:desat=0,zscale=t=bt709:m=bt709:r=tv,format=yuv420p,scale=1920:1080 -c:v h264_nvenc -b:v:0 8192k -c:a:0 aac -b:a 384k -ac 2 -metadata:s:a:3 title=“AAC 2.0” -movflags +faststart “M:\Test.mkv” -y

I’ve tried using the Plex Transcoder syntax and replace my -vf parameter with the -filter_complex one but then I get the following error: Filter format:default has an unconnected output. I’m assuming it is not as simple as changing one for the other and I must have other things in my command-line that doesn’t work with this approach.
ffmpeg -ss 00:20:00 -t 00:00:45 -i “M:\My video 4k HDR.mkv” -map 0:v -map 0:a:1 -filter_complex “[0:0]scale=w=1280:h=720:force_divisible_by=4[0];[0]format=p010,tonemap=mobius[1];[1]format=pix_fmts=yuv420p|nv12[2]” -c:v h264_nvenc -b:v:0 4096k -c:a:0 aac -b:a:0 384k -ac 2 -metadata:s:a:0 title=“AAC 2.0” -movflags +faststart “M:\Test.mkv” -y

thanks

Main reason: My Plex Server runs on a Synology NAS and the processor is not very performant which makes the conversion very slow. I want to run the conversion on my PC.

Finally, I am more familiar with ffmpeg, been using it for a few years for basic conversions but as I mentionned, HDR conversions specifically give me headaches.

thank you

Install PMS on your PC, but don’t start it.

That way, you have the binaries

I like Dane’s plan to use an un-setup PMS to have the transcoder.
Your second example looks curious how you have zscale twice.
Your third example if the quoting is okay, try removing the map command(s).
Github has some good bash scripts showing HDR to SDR tonemapping,
I haven’t messed with it much because I decided to upgrade my devices.
Let us know what works :slight_smile:

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.