Jump to content

Using a custom mpv.conf for Shaders and Dynamic Tone Mapping?


makin__

Recommended Posts

Hi everyone,

I just switched from Kodi and MPV as the external player to Emby as I really love the concept. However, I would like to use my own mpv.conf so I can set certain shaders and picture quality settings such as the hdr->sdr dynamic tone mapping (using spline) etc.

 

I tried to set up the mpv.conf at %appdata%\mpv\mpv.conf but it is ignored. 

Can you guys help me?

Thanks a lot

Link to comment
Share on other sites

Thanks for answering. The config I use for mpv is stored at mpv/portable_config/mpv.conf <- this one is not used by Emby Theater.

Link to comment
Share on other sites

generiq

Some options will be overridden by the options in Theater. Such as the gpu-api and hardware acceleration. But for hardware acceleration,  there is an option to let the conf set it.

Link to comment
Share on other sites

Ok, great. It's mainly HDR settings like:

[HDR-Spline]
profile-desc="HDR ST2094-10"
profile-cond=p["video-params/primaries"]=="bt.2020"
tone-mapping=spline
target-peak=auto
target-trc=auto
hdr-compute-peak=yes
allow-delayed-peak-detect
builtin-scalers
deband=no
tone-mapping-param=default
gamut-mapping-mode=relative
target-contrast=auto

And:
 

# Scaling
scale=ewa_lanczossharp # luma upscale
dscale=mitchell # luma downscale
cscale=ewa_lanczossharp # chroma up&downscale
scale-antiring=0.4 # luma upscale deringing
dscale-antiring=0.4 # luma downscale deringing
cscale-antiring=0.4 # chroma upscale deringing
correct-downscaling=yes
linear-downscaling=yes
#sigmoid-upscaling=yes
gpu-shader-cache-dir="C:\Program Files\mpv-x86_64\portable_config\shaders_cache"
glsl-shader="C:\Program Files\mpv-x86_64\portable_config\shaders\KrigBilateral.glsl"
glsl-shader="C:\Program Files\mpv-x86_64\portable_config\shaders\SSimDownscaler.glsl"
#glsl-shader="C:\Program Files\mpv-x86_64\portable_config\shaders\adaptive-sharpen.glsl"

See any problems?

Link to comment
Share on other sites

generiq

Most of that should be fine, just make sure that corresponding options in Theater are disabled, and leave everything else on auto except for video output. Choose gpu-next.

  • Like 1
Link to comment
Share on other sites

Just tried it and with the mpv.conf in C:\Program Files (x86)\mpv, it still does not work. Where can I find the logs to see whether Theater is at least trying to? 

Is there another mpv folder? What would have been if mpv wasn't installed in the first place? Theater must have mpv integrated somehow doesn't it?

What about C:\Users\makin\AppData\Roaming\Emby-Theater\system\electronapp\libmpv\x64?

I just stumbled upon this post here. In my initial post I mentioned that I tried C:\Users\makin\AppData\Roaming\mpv\mpv.conf at first.

 

 

 

 

Edited by makin__
Link to comment
Share on other sites

The logs:

2023-11-04 18:46:10.505 Info Main: Application path: C:\Users\kodi\AppData\Roaming\Emby-Theater\system\Emby.Theater.exe
2023-11-04 18:46:10.507 Info Main: Emby
    Command line: C:\Users\kodi\AppData\Roaming\Emby-Theater\system\Emby.Theater.exe
    Operating system: Microsoft Windows NT 10.0.19045.0
    64-Bit OS: True
    64-Bit Process: False
    User Interactive: True
    Processor count: 6
    Program data path: C:\Users\kodi\AppData\Roaming\Emby-Theater
    Application directory: C:\Users\kodi\AppData\Roaming\Emby-Theater\system
2023-11-04 18:46:10.546 Info Main: C:\Users\kodi\AppData\Roaming\Emby-Theater\system\x64\electron\electron.exe "C:\Users\kodi\AppData\Roaming\Emby-Theater\system\electronapp" "C:\Users\kodi\AppData\Roaming\Emby-Theater\data\electron" "C:\Users\kodi\AppData\Roaming\Emby-Theater\system\cec\cec-client.x64.exe" "C:\Users\kodi\AppData\Roaming\Emby-Theater\system\x64\mpv\mpv.exe"
2023-11-04 18:46:10.633 Info App: Application version: 3.0.20.0
2023-11-04 18:46:10.668 Info App: Application configuration:
    {"EnableDebugLevelLogging":false,"EnableAutoUpdate":true,"LogFileRetentionDays":3,"RunAtStartup":false,"IsStartupWizardCompleted":false}
2023-11-04 18:46:10.670 Info App: Loading MediaBrowser.Model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
2023-11-04 18:46:10.670 Info App: Loading MediaBrowser.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
2023-11-04 18:46:10.670 Info App: Loading Emby.Theater, Version=3.0.20.0, Culture=neutral, PublicKeyToken=null
2023-11-04 18:46:10.725 Info Main: HDMI CEC driver installation was previously cancelled.
2023-11-04 18:46:10.895 Info App: Core startup complete
2023-11-04 18:46:13.898 Info TaskManager: StartupTrigger fired for task: Check for application updates
2023-11-04 18:46:13.899 Info TaskManager: Queueing task SystemUpdateTask
2023-11-04 18:46:13.902 Info TaskManager: Executing Check for application updates
2023-11-04 18:46:13.925 Info HttpClient: HttpClientManager GET: https://api.github.com/repos/MediaBrowser/Emby.Theater.Windows/releases
2023-11-04 18:46:14.659 Info TaskManager: Check for application updates Completed after 0 minute(s) and 0 seconds
2023-11-04 18:46:14.687 Info TaskManager: ExecuteQueuedTasks
2023-11-04 18:47:36.941 Info Main: Http POST fileexists
2023-11-04 18:47:36.947 Info Main: Http Completed POST fileexists
2023-11-04 18:47:40.080 Info Main: Http POST fileexists
2023-11-04 18:47:40.080 Info Main: Http Completed POST fileexists
2023-11-04 18:48:44.291 Info App: Disposing ApplicationHost
2023-11-04 18:48:44.292 Info App: Disposing TaskManager
2023-11-04 18:48:44.293 Info App: Disposing InstallationManager
2023-11-04 18:48:44.294 Info Main: Releasing mutex
2023-11-04 18:48:44.294 Info Main: Releasing mutex

 

Link to comment
Share on other sites

generiq

It looks like you've installed Theater here:

C:\Users\kodi\AppData\Roaming

So your mpv folder should be there, under that username

Link to comment
Share on other sites

generiq

It's reading auto profiles from somewhere 

[   0.866][v][cplayer] Applying profile 'HDR'...
[   0.866][v][cplayer] Setting option 'target-trc' = 'auto' (flags = 4)
[   0.866][v][cplayer] Setting option 'target-peak' = '120' (flags = 4)

 

Link to comment
Share on other sites

generiq

Make sure you don't have conflicting mpv.conf files. You should have one in your mpv folder for one user and one in your portable.  No others

Edited by generiq
Link to comment
Share on other sites

Sorry, my user is „Kodi“, I did not want to confuse so that’s why I posted another user name (makin). 
 

I guess input.conf does not work and the info in the nerd menu is not altered right? 

Link to comment
Share on other sites

generiq

Inputs are handled by electron. And the Theater stats won't show shader activity or any profiles. You'll need to look at your mpv logs 

  • Thanks 1
Link to comment
Share on other sites

Thank you so much. I got a plan for tomorrow then. 🙂
 

Any feedback regarding shaders?

 

Edited by makin__
Link to comment
Share on other sites

generiq

You should be able to. You just need to keep up to date with developments. Not only with the shaders but also with what hassn is developing with libplacebo and the renderers. There's no simple answer to that. You're going to have to manage what you use and read a lot. There is so much development in this area right now. 

Link to comment
Share on other sites

Short update after tweaking the mpv.conf. My current mpv.conf:

log-file="C:\Users\kodi\AppData\Roaming\mpv\mpv.log"

save-position-on-quit=yes

# certain scripts
load-scripts=yes

hwdec=d3d11va
gpu-api=d3d11
gpu-context=d3d11
video-output-levels=full
fbo-format=auto # fbo-format=rgba16f alternative
deband=yes
dither-depth=auto
dither=fruit

scale=ewa_lanczossharp
dscale=mitchell
cscale=ewa_lanczossharp
scale-antiring=0.4
dscale-antiring=0.4
cscale-antiring=0.4
correct-downscaling=yes
linear-downscaling=yes

gpu-shader-cache-dir="C:\Users\kodi\AppData\Roaming\mpv\shaders_cache"
glsl-shaders="C:\Users\kodi\AppData\Roaming\mpv\shaders\FSRCNNX_x2_8-0-4-1.glsl"
glsl-shaders-append="C:\Users\kodi\AppData\Roaming\mpv\shaders\adaptive-sharpen.glsl"
glsl-shaders-append="C:\Users\kodi\AppData\Roaming\mpv\shaders\KrigBilateral.glsl"

[HDR]
profile-desc="HDR"
profile-cond=p["video-params/gamma"]=="pq"
target-trc=auto
target-peak=120
tone-mapping=spline
hdr-compute-peak=yes
gamut-mapping-mode=relative
target-prim=bt.2020

[HDR-Old]
profile-desc="HDR-Old"
target-trc=auto
target-peak=120
target-prim=bt.2020 
tone-mapping=bt.2390
hdr-compute-peak=yes


[SDR]
profile-desc="SDR"
profile-cond=p["video-params/primaries"]~=nil and p["video-params/primaries"]~="bt.2020"
glsl-shaders="C:\Users\kodi\AppData\Roaming\mpv\shaders\FSRCNNX_x2_8-0-4-1.glsl"


[25fps]
profile-cond=get("estimated-vf-fps", -math.huge)==25
speed=0.95

mpv.log

I attached the mpv.log created after starting and playing back a movie (4K). It looks good so far. What do you think? See any issues in the log?

 

Thanks again for guiding me through everything, I really appreciate it.

Edited by makin__
Link to comment
Share on other sites

Also, I could have sworn that before restarting the Emby Server, my Safari, Chrome ans iOS apps did not have to transcode (Audio), any idea what might cause this? ET does not have to...

 

image.png.ce9a6835fb5d7d61185a5f6ec635838b.png

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...