# FFMPEG parameters

**URL:** <https://forums.plex.tv/t/ffmpeg-parameters/812027>\
**Category:** General Discussions\
**Tags:** media-optimizer\
**Created:** [September 23, 2022, 1:42pm UTC](https://forums.plex.tv/t/ffmpeg-parameters/812027 "2022-09-23T13:42:13Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![jgauthier72](https://avatars.discourse-cdn.com/v4/letter/j/87869e/32.png) [@jgauthier72](https://forums.plex.tv/u/jgauthier72)\
**Post date:** [September 23, 2022, 1:42pm UTC](https://forums.plex.tv/t/ffmpeg-parameters/812027/1 "2022-09-23T13:42:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dane22](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/dane22/32/4389_2.png) [@dane22](https://forums.plex.tv/u/dane22)\
**Post date:** [September 23, 2022, 1:50pm UTC](https://forums.plex.tv/t/ffmpeg-parameters/812027/2 "2022-09-23T13:50:34Z")

</div>

Plex Media Server.log

Search for the word: `Plex Transcoder`

---

<div class="post-metadata">

**Author:** ![jgauthier72](https://avatars.discourse-cdn.com/v4/letter/j/87869e/32.png) [@jgauthier72](https://forums.plex.tv/u/jgauthier72)\
**Post date:** [September 24, 2022, 8:33pm UTC](https://forums.plex.tv/t/ffmpeg-parameters/812027/3 "2022-09-24T20:33:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dane22](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/dane22/32/4389_2.png) [@dane22](https://forums.plex.tv/u/dane22)\
**Post date:** [September 24, 2022, 8:38pm UTC](https://forums.plex.tv/t/ffmpeg-parameters/812027/4 "2022-09-24T20:38:26Z")

</div>

> [@jgauthier72](#):
>
> Could you confirm whether Plex uses ffmpeg for manual optimizations

Plex Transcoder is ffmpeg, just a special build

Check the License file located in PMS Install Dir/Resources

---

<div class="post-metadata">

**Author:** ![jgauthier72](https://avatars.discourse-cdn.com/v4/letter/j/87869e/32.png) [@jgauthier72](https://forums.plex.tv/u/jgauthier72)\
**Post date:** [September 24, 2022, 8:42pm UTC](https://forums.plex.tv/t/ffmpeg-parameters/812027/5 "2022-09-24T20:42:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dane22](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/dane22/32/4389_2.png) [@dane22](https://forums.plex.tv/u/dane22)\
**Post date:** [September 24, 2022, 8:43pm UTC](https://forums.plex.tv/t/ffmpeg-parameters/812027/6 "2022-09-24T20:43:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![nibbles](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/nibbles/32/150497_2.png) [@nibbles](https://forums.plex.tv/u/nibbles)\
**Post date:** [September 24, 2022, 9:23pm UTC](https://forums.plex.tv/t/ffmpeg-parameters/812027/7 "2022-09-24T21:23:02Z")

</div>

> [@jgauthier72](#):
>
> 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.

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 😛

---

<div class="post-metadata">

**Author:** ![dane22](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/dane22/32/4389_2.png) [@dane22](https://forums.plex.tv/u/dane22)\
**Post date:** [September 24, 2022, 9:25pm UTC](https://forums.plex.tv/t/ffmpeg-parameters/812027/8 "2022-09-24T21:25:16Z")

</div>

And adding to @nibbles here…

In the [PMS logs,](https://support.plex.tv/articles/200250417-plex-media-server-log-files/) 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

---

<div class="post-metadata">

**Author:** ![dane22](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/dane22/32/4389_2.png) [@dane22](https://forums.plex.tv/u/dane22)\
**Post date:** [September 24, 2022, 9:29pm UTC](https://forums.plex.tv/t/ffmpeg-parameters/812027/9 "2022-09-24T21:29:08Z")

</div>

Below is a cut of sample of what I mean:

 ![image](https://global.discourse-cdn.com/plex/original/4X/8/f/e/8fe01ea30d4e0bf486adff33857cab95bc1bd76d.png)

 ![image](https://global.discourse-cdn.com/plex/original/4X/3/d/3/3d396d002ca02a4d43c8660e91fce5c1364c53e9.png)

---

<div class="post-metadata">

**Author:** ![nibbles](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/nibbles/32/150497_2.png) [@nibbles](https://forums.plex.tv/u/nibbles)\
**Post date:** [September 24, 2022, 10:04pm UTC](https://forums.plex.tv/t/ffmpeg-parameters/812027/10 "2022-09-24T22:04:12Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dane22](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/dane22/32/4389_2.png) [@dane22](https://forums.plex.tv/u/dane22)\
**Post date:** [September 24, 2022, 10:07pm UTC](https://forums.plex.tv/t/ffmpeg-parameters/812027/11 "2022-09-24T22:07:41Z")

</div>

> [@nibbles](#):
>
> 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 😉

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 😉

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

---

<div class="post-metadata">

**Author:** ![jgauthier72](https://avatars.discourse-cdn.com/v4/letter/j/87869e/32.png) [@jgauthier72](https://forums.plex.tv/u/jgauthier72)\
**Post date:** [September 25, 2022, 2:50pm UTC](https://forums.plex.tv/t/ffmpeg-parameters/812027/12 "2022-09-25T14:50:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jgauthier72](https://avatars.discourse-cdn.com/v4/letter/j/87869e/32.png) [@jgauthier72](https://forums.plex.tv/u/jgauthier72)\
**Post date:** [September 25, 2022, 2:54pm UTC](https://forums.plex.tv/t/ffmpeg-parameters/812027/13 "2022-09-25T14:54:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dane22](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/dane22/32/4389_2.png) [@dane22](https://forums.plex.tv/u/dane22)\
**Post date:** [September 25, 2022, 4:00pm UTC](https://forums.plex.tv/t/ffmpeg-parameters/812027/14 "2022-09-25T16:00:13Z")

</div>

> [@jgauthier72](#):
>
> I want to run the conversion on my PC.

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

That way, you have the binaries

---

<div class="post-metadata">

**Author:** ![nibbles](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/nibbles/32/150497_2.png) [@nibbles](https://forums.plex.tv/u/nibbles)\
**Post date:** [September 25, 2022, 5:32pm UTC](https://forums.plex.tv/t/ffmpeg-parameters/812027/15 "2022-09-25T17:32:30Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [December 24, 2022, 5:32pm UTC](https://forums.plex.tv/t/ffmpeg-parameters/812027/16 "2022-12-24T17:32:37Z")

</div>

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