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 20th February 2021, 17:46   #81  |  Link
butterw2
Registered User
 
Join Date: Jun 2020
Posts: 204
#mpv built-in scalers

mpv has a number of built-in scalers (they can be listed with mpv --scale=help), which can be specified via command-line or mpv.conf:
--scale=catmull_rom #lanczos #spline16
--cscale=bilinear
--dscale=mitchell
These settings are OK for integrated gpu use. Bilinear is the fastest but doesn't give great results, mitchell (B=1/3., C=1/3.) is smooth, catmull_rom (mitchell-netvrali with B=0, C=0.5) is quite sharp

The scaler is used when the output resolution on screen is different from the source resolution.
- scale is used for upscaling, and also downscaling (if dscale isn't specified)
- dscale is used for downscaling
- cscale is used for chroma upsampling.

It is possible to define a hotkey in input.conf to switch between scalers, ex:
F8 cycle-values scale bilinear mitchell catmull_rom lanczos

A 24bit .png image file can be used as input for testing. The difference are visible but not that huge with typical (ex 720p to 1080p) upscaling.

Last edited by butterw2; 26th February 2021 at 11:12.
butterw2 is offline   Reply With Quote
Old 25th February 2021, 13:14   #82  |  Link
butterw2
Registered User
 
Join Date: Jun 2020
Posts: 204
#How to change settings/properties in mpv https://mpv.io/manual/master/#properties

Settings control in mpv:
1) Initial settings (determined by: 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 do this ?
- 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 not currently 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 custom input.conf (hotkey/commands):
- toggle individual filters/shaders in the chain, ex: F1 change-list glsl-shaders toggle "noChroma.hk"
- set values, ex: CTRL+ change-list glsl-shaders set "",
- cycle-values with a custom list, ex: F8 cycle-values scale bilinear mitchell catmull_rom lanczos
- commands can be added via external script functions
...Scripts in lua or javascript 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 console, or use the window title bar)

Last edited by butterw2; 26th February 2021 at 11:08. Reason: updated2
butterw2 is offline   Reply With Quote
Old 28th February 2021, 19:23   #83  |  Link
butterw2
Registered User
 
Join Date: Jun 2020
Posts: 204
#Custom contextual menu in mpvnet
result obtained: https://files.videohelp.com/u/295418/mpvnet_menu.jpg
The menu gives access to the recent file list, the chapters list and the open file dialog.
Unlike in mpv, runtime commands do not have to be associated to hotkeys (they can be launched though the menu or the command-palette).

In mpv.net, Input.conf defines the key and mouse bindings and the context menu. It's easy to create a custom contextual menu.
The default contextual menu is quite cluttered, I wanted to create a more minimalistic one. Mpvnet has a searchable command palette which lists all available commands, which is allows to keep a large number of commands available.

Original menu

Last edited by butterw2; 8th March 2021 at 19:11.
butterw2 is offline   Reply With Quote
Old 8th March 2021, 20:00   #84  |  Link
butterw2
Registered User
 
Join Date: Jun 2020
Posts: 204
#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   #85  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,717
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   #86  |  Link
butterw2
Registered User
 
Join Date: Jun 2020
Posts: 204
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   #87  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,717
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   #88  |  Link
butterw2
Registered User
 
Join Date: Jun 2020
Posts: 204
Quote:
Originally Posted by stax76 View Post
Download can be found on the front page:

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

Not sure what else I could do.
Providing a direct link to the beta (in the 1st or last post) of your forum thread would help.

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.

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

I can try fixing both.
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.

title: displays information in the window title. in mpv it's the easiest way to display updated info. This is a great customization feature if it can be implemented in mpvnet.
butterw2 is offline   Reply With Quote
Old 10th March 2021, 13:30   #89  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,717
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   #90  |  Link
butterw2
Registered User
 
Join Date: Jun 2020
Posts: 204
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, 12:50   #91  |  Link
butterw2
Registered User
 
Join Date: Jun 2020
Posts: 204
hotfix mpvnet.exe 2021/10/03 feedback:
- I've replied at github concerning the remaining issues with the command palette improvement.

- mpvnet title testing (previously: title was ignored):
At startup: title can only be set to a string, not to a property, this becomes the default value.

with mpv.conf or startup option: --title = "${path}: ${glsl-shaders}"
displays ${path}: ${glsl-shaders} in window title, not the property values !

- it can be set at runtime, but the value doesn't update dynamically like in mpv and gets reset to default when a new file is loaded:

input.conf:
Code:
 F7 set title "${path}:ok"

Last edited by butterw2; 11th March 2021 at 12:53.
butterw2 is offline   Reply With Quote
Old 11th March 2021, 19:25   #92  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,717
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   #93  |  Link
butterw2
Registered User
 
Join Date: Jun 2020
Posts: 204
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   #94  |  Link
ericgl
Registered User
 
Join Date: Sep 2015
Posts: 2
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   #95  |  Link
butterw2
Registered User
 
Join Date: Jun 2020
Posts: 204
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   #96  |  Link
Aleksoid1978
Registered User
 
Aleksoid1978's Avatar
 
Join Date: Apr 2008
Location: Russia, Vladivostok
Posts: 2,560
There is no software player that support pure DolbyVision, except Windows 10 "Movie and TV".
__________________
AMD Ryzen 5 3600 /GIGABYTE B450 Gaming X /AMD Radeon R9 16Gb@3200 /Kingston 500Gb M.2 /GTX 1650 /Samsung U28R550UQI /LG 47LM620T /Yamaha RX-V471 + NS-555 + NS-C444 + NS-333 + YST-SW215
Aleksoid1978 is offline   Reply With Quote
Old 22nd April 2021, 14:06   #97  |  Link
ericgl
Registered User
 
Join Date: Sep 2015
Posts: 2
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
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 15:12.


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