Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Hardware & Software > Software players

Reply
 
Thread Tools Search this Thread Display Modes
Old 25th February 2021, 13:14   #81  |  Link
butterw2
Registered User
 
Join Date: Jun 2020
Posts: 303
#Change settings/properties in mpv https://mpv.io/manual/master/#properties

1) Initial settings (determined by: program defaults < mpv.conf < command-line options incl. profile)
2) Runtime changes (via hotkey/command): current settings, disable/restore settings (via script)
3) Show settings
4) quit-watch-later: partial save of per file settings

Motivation for changing settings at runtime:
- tweak settings based on the video being displayed
- improve performance on some files (ex: on integrated graphics)
- try out effects
Runtime settings do not persist beyond the current session.

How to change settings at runtime ?
- with input.conf custom hotkey/commands or scripts
- Multiple [profiles] can be defined in mpv.conf (startup profile can be specified via command-line option).
- (Almost all ?) settings can be changed at runtime without restarting mpv through hotkey/commands (ex: switch profiles, or change a video filter/or glsl shader setting).
- Partial per file settings persistence is possible via watch-later folder: some pre-defined settings (the list is user-customizable) can be written to disk and will then be used by default the next time the same file is played.

Display pipeline: video.mp4 (ex: 720p, yuv420) > --vf (ex: hqnd3d) > color controls (ex: --saturation) > LUMA, CHROMA (ex: noChroma.hook) > cscale > rgb: MAIN (ex: clut shader kodachrome-9.hk;bw.hook) > scale > OUTPUT (ex: Filmgrain.hk) > rgba display (ex: 1080p)

Changing/displaying mpv settings at runtime with input.conf (custom hotkey/commands):
- toggle individual filters/shaders in the chain, ex: F1 change-list glsl-shaders toggle "noChroma.hk"
- set values, ex: CTRL+DEL change-list glsl-shaders set "",
- cycle between chosen values, ex: F8 cycle-values scale bilinear mitchell catmull_rom lanczos
- commands can be added via external script functions
...Scripts (lua or javascript or c-plugin) in ./scripts folder are autoloaded by default
...stats.lua and osc.lua are built-in scripts. They can be configured in ./script-opts
- Save/restore current settings (with an external script), ex: CTRL+p script-message switch-shaders
- Display current settings (show-text on OSD or print-text to the terminal, or display in the window title bar or the terminal status line)

Last edited by butterw2; 25th December 2023 at 22:25. Reason: updated
butterw2 is offline   Reply With Quote
Old 28th February 2021, 19:23   #82  |  Link
butterw2
Registered User
 
Join Date: Jun 2020
Posts: 303
#Custom contextual menu in mpvnet

In mpv.net, input.conf defines the key and mouse bindings and the context menu, so it's easy to create a custom contextual menu.
The menu gives access to the recent file list, the chapters list and the open file dialog. The default menu felt a bit cluttered, so I wanted to create a more minimalistic one.
Original menu / my version


Mpvnet has a searchable command palette component listing all available commands. This allows to keep a large number of commands available.
Unlike in mpv, runtime commands do not have to be associated to hotkeys (they can still be launched through the menu or the command-palette).

Last edited by butterw2; 21st December 2023 at 23:05.
butterw2 is offline   Reply With Quote
Old 8th March 2021, 20:00   #83  |  Link
butterw2
Registered User
 
Join Date: Jun 2020
Posts: 303
#hqdn3d fast spatio-temporal denoiser

Most shader implementations have the limitation that only the current frame is available as input. This means temporal algorithms cannot be implemented.
This obviously isn't a problem when adapting algorithms which originate from image processing, however temporal issues do often have a big impact on the result achieved with video input (vs a fixed image).
To limit this problem, it makes sense to clean the source of temporal fluctuations as much as possible. While spatio-temporal denoising should be applied prior to encoding or to an extent by the codec itself (with modern codecs), there is frequently a benefit to apply further spatio-temporal source denoising before further processing is applied by shaders.

hqdn3d (hq mplayer spatio-temporal denoise) is a low cost cpu spatio-temporal denoiser. It is widely available, including in ffmpeg and as a result can be used in mpv.
hqdn3d(2) is equivalent to hqdn3d(ls=2, cs=1.5, lt=3, ct=2.25), the default is ls=4.0
I would recommend switching it on with lower setting on sources which require it. It runs well on 720p videos even on an old cpu.
add the following to input.conf, and turn it on with hotkey h:
h vf toggle "hqdn3d=2"

It should be noted that while temporal methods are great to remove temporal noise on backgrounds, they are not applicable to sources with fast motion.
butterw2 is offline   Reply With Quote
Old 9th March 2021, 10:48   #84  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
Quote:
minimum-aspect-ratio = 0.5 #resize the window when the input is portrait-mode AR.
As a suggestion, why not list all the mpvnet-specific config parameter with their defaults in this file ?
You can find mpv.net specific options in the conf editor using the search feature searching for 'mpv.net', but I also added now all mpv.net specific options to the mpv.net manual:

mpv.net specific options

Quote:
I also got multiple popup errors when opening mpvnet (I had syntax errors in mpv.conf): I probably shouldn't get more than one of these, and the message does seem a little cryptic.
Uppercase char detected: R
mpv properties using the command line and the mpv.conf config file are required to be lowercase.

I also got these when launching from command-line: it would probably be better to just print the error and continue in this case. If I type garbage in mpv.conf, base mpv provides much clearer and more precise error info.
I agree the mpv message on the command line is sufficient, next build has this message box warning removed.

Quote:
Next I'm going to copy my input.conf and maybe try to customize (meaning trim down) the context menu.
I'm using mostly the defaults, OK it was created by me. 🙂

Thank you for the feedback.
stax76 is offline   Reply With Quote
Old 9th March 2021, 13:29   #85  |  Link
butterw2
Registered User
 
Join Date: Jun 2020
Posts: 303
Quote:
Originally Posted by stax76 View Post
You can find mpv.net specific options in the conf editor using the search feature searching for 'mpv.net', but I also added now all mpv.net specific options to the mpv.net manual:

mpv.net specific options
I've downloaded 5.4.8.7 Beta (2021-03-09) from dropbox, but the link was hard to find: the mpv.net manual is where to look.

mpvnet has a number of Window Limitations vs regular mpv.
some window properties are ignored, ex: --title which I use to display information in mpv. But also window-scale, etc.

--video-file-extensions=<string>
please provide example values, including how to disable picture files in auto-load-folder
mpvnet.conf:
image-file-extensions = jpg png
image-file-extensions = #disables image files
#image-file-extensions = #go back to default (all ext)
butterw2 is offline   Reply With Quote
Old 9th March 2021, 18:16   #86  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
Download can be found on the front page:

https://github.com/stax76/mpv.net#table-of-contents

Not sure what else I could do.

There is an implementation for window-scale in mpv.net, but it works differently on purpose because I found the mpv behavior useless, what's the point of scaling based on the native video size? I'm not getting it but can try to implement it if people care.

--title might be something that is easy to implement.

I can try fixing both.

Quote:
please provide example values, including how to disable picture files in auto-load-folder
image-file-extensions = nothing

image-file-extensions = jpg bmp

The file extensions can be separated by space, comma and semicolon.

Last edited by stax76; 9th March 2021 at 18:22.
stax76 is offline   Reply With Quote
Old 9th March 2021, 19:38   #87  |  Link
butterw2
Registered User
 
Join Date: Jun 2020
Posts: 303
Quote:
Originally Posted by stax76
There is an implementation for window-scale in mpv.net, but it works differently on purpose because I found the mpv behavior useless, what's the point of scaling based on the native video size? I'm not getting it but can try to implement it if people care.
window-scale: if you have an old 4/3 360p video it may look quite ugly when scaled fullscreen.
This is the same as mpc-hc: View > zoom which has 3 main values: 50%, 100% and 200%.
100% zoom turns off scaling.
200% zoom should still look OK and is integer ratio scaling.
It's a useful feature on some files, not something meant to be used by default.

Last edited by butterw2; 21st December 2023 at 23:08.
butterw2 is offline   Reply With Quote
Old 10th March 2021, 13:30   #88  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
Quote:
Providing a direct link to the beta (in the 1st or last post) of your forum thread would help.
I like to keep my first posts as simple as possible.

There is a new hotfix online:

- The mpv window-scale property works now exactly like in mpv.
- Implementation for the mpv title property.

https://github.com/stax76/mpv.net/bl....conf.txt#L144

Btw. I noticed the mpv implementation of window-scale is buggy, which supports my claim that it's useless in the first place. I start mpv passing a video file to play, I set window-scale 1.0, nothing happens, very useful feature.

I try not to lament, but every second request on my issue tracker is window related, 9 out of 10 window requests are strange, I've already wasted a ridiculous amount of time working on these requests.
stax76 is offline   Reply With Quote
Old 10th March 2021, 15:27   #89  |  Link
butterw2
Registered User
 
Join Date: Jun 2020
Posts: 303
Quote:
Originally Posted by stax76 View Post
I like to keep my first posts as simple as possible.

There is a new hotfix online:

- The mpv window-scale property works now exactly like in mpv.
- Implementation for the mpv title property.

https://github.com/stax76/mpv.net/bl....conf.txt#L144

Btw. I noticed the mpv implementation of window-scale is buggy, which supports my claim that it's useless in the first place. I start mpv passing a video file to play, I set window-scale 1.0, nothing happens, very useful feature.
In mpv, window-scale isn't a useful as a startup option as it gets overriden, but I do find it useful at runtime (for low-res or extra high-res videos).
I use this in my mpv.conf (1x size window, unless the video is wider than 1280):
# window will not have a width larger than 1280pixels:
autofit-larger=1280

Window and frame size isn't all that simple:
mpc-hc for instance has many different ways to specify the window size, aspect-ratio, crop, zoom behavior... and some of these parameters are not exclusive.


The mpvnet version of window-scale is now identified differently from the mpv original, which is less confusing.

EDIT: window-scale seems to work as expected in latest hotfix mpvnet.exe

Last edited by butterw2; 11th March 2021 at 19:52.
butterw2 is offline   Reply With Quote
Old 11th March 2021, 19:25   #90  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
I want to improve the command palette, if you show the command palette in VS Code or Windows Terminal with Ctrl+Shift+P you see a command palette that looks much nicer than the one in mpv.net. It's going to be difficult to code, and might need migrating to .NET 5 and give up Win 7 and old Windows 10 versions, hopefully not. It's too much work to build a dedicated playlist dialog, but I can re-use the command palette infrastructure as playlist UI.

This title issue turned out to be fairly complex, I can try to get it, but need a small break first anyway, staxrip maintenance caused some stress lately.

If this thread is about shaders, better post in the other mpv thread.
stax76 is offline   Reply With Quote
Old 12th March 2021, 10:10   #91  |  Link
butterw2
Registered User
 
Join Date: Jun 2020
Posts: 303
Quote:
Originally Posted by stax76 View Post
It's going to be difficult to code, and might need migrating to .NET 5 and give up Win 7 and old Windows 10 versions, hopefully not.
I run an old Win10 version, so I wouldn't be able to use it.

One of the issues with user shaders is that passing parameters to individual shaders in the chain isn't simple (the player needs to set uniforms/registers). The workaround in mpv has been to create multiple versions of each shader with different sets of parameter values. While this works, its also hard to use.
One of the benefits of having a GUI is allowing user runtime configuration of shaders (ex: turn on and increase the strength of filmgrain, because the source requires it).
The command palette interface is easy to use and allows having many commands available without a cluttered GUI.

Last edited by butterw2; 12th March 2021 at 10:13.
butterw2 is offline   Reply With Quote
Old 22nd April 2021, 10:44   #92  |  Link
ericgl
Registered User
 
ericgl's Avatar
 
Join Date: Sep 2015
Posts: 4
Hello,
Is there a shader that can fix the colors of DolbyVision movies?
I don't have any monitors or TVs that support DolbyVision HDR.
The colors are off - Everything looks green and red.
I was hoping there's a shader that can fix that...

Upon further investigation, it seems that DolbyVision content without the EL component displays wrong/shifted colors.
In the following screenshot, you can see that this DolbyVision content only has the BL+RPU components:



A user called "Doofussy2" found this issue and reported it on github: https://github.com/mpv-player/mpv/issues/7326

Last edited by ericgl; 22nd April 2021 at 11:04.
ericgl is offline   Reply With Quote
Old 22nd April 2021, 12:29   #93  |  Link
butterw2
Registered User
 
Join Date: Jun 2020
Posts: 303
Try mpc-be which has some built-in HDRtoSDR shaders.
HDR10 and HLG should work with a recent version, but I don't know about HDR10+: You can ask the devs about this in the mpc-be thread.

Dolby vision comes up in encoding topics also.
butterw2 is offline   Reply With Quote
Old 22nd April 2021, 13:20   #94  |  Link
Aleksoid1978
Registered User
 
Aleksoid1978's Avatar
 
Join Date: Apr 2008
Location: Russia, Vladivostok
Posts: 2,783
There is no software player that support pure DolbyVision, except Windows 10 "Movie and TV".
__________________
AMD Ryzen 5 3600 /GIGABYTE B450 Gaming X /Patriot 32Gb@3200 /Kingston 500Gb M.2 /RTX 4060 /Samsung U28R550UQI /OLED Philips 55OLED707 /Yamaha RX-V471 + NS-555 + NS-C444 + NS-333 + YST-SW215
Aleksoid1978 is offline   Reply With Quote
Old 22nd April 2021, 14:06   #95  |  Link
ericgl
Registered User
 
ericgl's Avatar
 
Join Date: Sep 2015
Posts: 4
Quote:
Originally Posted by butterw2 View Post
Try mpc-be which has some built-in HDRtoSDR shaders.
HDR10 and HLG should work with a recent version, but I don't know about HDR10+: You can ask the devs about this in the mpc-be thread.

Dolby vision comes up in encoding topics also.
If you look at the screenshot, I am using MPC-BE.

@Aleksoid,
OK, I will check DolbyVision content with the "Movie and TV" app on Win10. Thanks!

Last edited by ericgl; 22nd April 2021 at 15:10.
ericgl is offline   Reply With Quote
Old 9th June 2021, 10:56   #96  |  Link
Dragonkris
Registered User
 
Join Date: Jun 2021
Posts: 2
Hey does anyone know if there is a .hlsl shaders code for Transpose & Anti-Transpose (Flip Video) like in VLC player?
Dragonkris is offline   Reply With Quote
Old 9th June 2021, 13:34   #97  |  Link
butterw2
Registered User
 
Join Date: Jun 2020
Posts: 303
It's often called rotate (90°) and yes most video players have this feature.

It's not typically done with user pixel shaders though, as they can't change the size/AR of the frame.
butterw2 is offline   Reply With Quote
Old 11th June 2021, 01:27   #98  |  Link
Dragonkris
Registered User
 
Join Date: Jun 2021
Posts: 2
Hmm so from what I’m getting at is the Pns Rotations for Y & Z were removed from MPC-BE, is there anyway to add them back in?
Dragonkris is offline   Reply With Quote
Old 11th June 2021, 10:04   #99  |  Link
butterw2
Registered User
 
Join Date: Jun 2020
Posts: 303
A Mirror operation is trivial to achieve with shaders. The difficulty with rotate is caused by the necessary resizing of the frame (assuming W!=H).
I would expect a rotate feature to be available in a video players, but there might be bugs/limitations. You can ask your question in the mpc-be thread.
The main use case for rotate is to correct for videos captured with a tilted camera/phone (ex: mp4 rotation flag).
butterw2 is offline   Reply With Quote
Old 21st October 2021, 23:52   #100  |  Link
Acba
Registered User
 
Join Date: Oct 2021
Posts: 2
Is it possible to adapt a shader to act just in half side of screen?

I would like some existing mpc-hc shaders, like "luma sharpen" or "lcd angle correction", to have effect just in the left half of a video, when the video is displayed in full screen.

Is there a way to add some lines to the beginning of the shader code so that it only acts in the left/right/top/bottom half of my screen?
Acba is offline   Reply With Quote
Reply

Tags
hlsl, mpc-be, mpc-hc, mpv, pixel shaders

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 14:12.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.