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. |
![]() |
#101 | Link |
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? |
![]() |
![]() |
![]() |
#102 | Link | |
Registered User
Join Date: Dec 2008
Posts: 1,885
|
Quote:
Code:
float4 main(float2 tex : TEXCOORD0) : COLOR { if (tex.x > 0.5) return tex2D(s0, tex); ...
__________________
MPC-BE 1.6.9 and Nightly builds | VideoRenderer | ImageSource | ScriptSource | BassAudioSource |
|
![]() |
![]() |
![]() |
#104 | Link |
Registered User
Join Date: Jun 2020
Posts: 269
|
HideWindowedControls
## mpc-hc HideWindowedControls
Options > Advanced > HideWindowedControls This Advanced option was added a while back to mpc-hc and helps modernize the windowed mode UI a lot. The toolbar is displayed only when the mouse hovers the bottom of the window similar to what happens by default in full screen mode. The result reduces the windows height and IMO looks much better. The configuration for the following win10 window screenshot is: normal preset + dark mode theme + hidden menubar I'm using the following advanced options: - DefaultToolbarSize=18. - status bar display: codec/resolution + frame rate the video resolution is 576x1024. https://raw.githubusercontent.com/bu...edControls.jpg The top menubar can be displayed if needed with the Alt key or the right-mouse click menu can be used instead. EDIT: The Controls toolbar isn't typically very useful in mpc-hc, and can be disabled if you are familiar with the basic keyboard shortcuts.
__________________
bShaders: realtime Effects/filters for video players Last edited by butterw2; 23rd May 2023 at 00:36. |
![]() |
![]() |
![]() |
#105 | Link | |
Registered User
Join Date: Jun 2020
Posts: 269
|
Quote:
The result seem OK (nothing magical) but are achieved with very low cpu/gpu usage. I believe intel vsr should also be available in Chrome web browser, but I haven't tried this yet
__________________
bShaders: realtime Effects/filters for video players |
|
![]() |
![]() |
![]() |
#106 | Link |
Registered User
Join Date: Jun 2020
Posts: 269
|
mpc-be: window (minimal) + seekbar, no OSD filename
my config for mpc-be windowed mode:
- Minimal Preset (no window bar, hidden Menubar, hidden Toolbar) - keep Flybar (displays when the mouse hovers at the top of the window and times out unless locked) + seekbar - Show OSD + show seek time enabled, show filename disabled (can be toggled in Options>Player without restarting the player) - HideWindowedMousePointer (time out) - Window Size: after starting Playback, scale to video size: 100%. - SnapToDesktopEdges. ![]() The screenshot shows the default flybar, it's possible to change it by putting a custom flybar.svg file in the mpc-be folder. Chapter markers can be displayed in the seekbar by toggling Options > Player > Interface > x use Chapter Markers. When enabled the OSD display can show filename, playtime, clock, and feedback information such as Volume, Zoom. However no time-out is applied when the OSD keyboard shortcuts are used (it's ON until you toggle OFF, even restarting the player doesn't help!). In fullscreen mode I would typically prefer the default Normal preset (the toolbar/seekbar autohide) with full OSD, but I don't think it is possible to configure two different custom setups for windowed and fullscreen mode.
__________________
bShaders: realtime Effects/filters for video players Last edited by butterw2; 19th August 2023 at 00:26. |
![]() |
![]() |
![]() |
#107 | Link | |
Registered User
Join Date: Feb 2019
Posts: 226
|
Quote:
When I use the super resolution on my desktop it takes almost all of my RTX 3080 and shoots up to 300W power usage. |
|
![]() |
![]() |
![]() |
#108 | Link |
Registered User
Join Date: Jun 2020
Posts: 269
|
SuperResolution magic is not working for me.
![]() with Intel Arc & Iris Xe Graphics WHQL graphics driver 31.0.101.4369 on Win10 22H2. using mpc-be + mpcvr / intel dx11 vp for resizing. The igpu (uhd730) is using 7W when upscaling 480p to 1080p (1% cpu, 10% gpu). Sharpness is similar to lanczos3 shader.
__________________
bShaders: realtime Effects/filters for video players |
![]() |
![]() |
![]() |
#109 | Link |
Registered User
Join Date: Oct 2012
Posts: 7,732
|
can you try this on the uhd730 and share me an upscaled image?
https://drive.google.com/file/d/1B0H...ew?usp=sharing |
![]() |
![]() |
![]() |
#110 | Link |
Registered User
Join Date: Jun 2020
Posts: 269
|
Low bitrate (<1Mbps, ex: 500kbps) youtube streams
- mpc-be can open youtube urls (via copy-paste) and play the video efficiently. - Youtube encoded 480p videos don't look good upscaled to 1080p on a monitor. They look OK at 100% zoom. - Well encoded 720p can upscale decently to 1080p. For similar bitrates, 720p-av1 (if available) would be preferable over youtube 480p-avc. - Hardware decoders: Whereas even very old computers have h264-dec, only recent generations of gpu/igpu have av1-dec. Still it should be possible to play 720p av1 in software on a PC. Otherwise vp9 hw-dec are more widely available (vp9 uses webm container). When the hw-dec is used, GPU is circled in the mpc-be Controls toolbar at the bottom of the screen. mpc-be: Options > Playback > Online media services with the built-in web page parser (you can also use a youtube-dl variant executable) Preferred format: mp4-av1 720p (alternative options: mp4, webm, +60fps)
__________________
bShaders: realtime Effects/filters for video players |
![]() |
![]() |
![]() |
#111 | Link | |
Registered User
Join Date: Jun 2020
Posts: 269
|
Quote:
https://files.videohelp.com/u/295418...pscale.png.zip I can confirm the superresolution option doesn't change the output on this setup. Do you have a 1080p picture of the test patterns for reference ?
__________________
bShaders: realtime Effects/filters for video players |
|
![]() |
![]() |
![]() |
#112 | Link |
Registered User
Join Date: Oct 2012
Posts: 7,732
|
there is no reference.
this image show that the scaler should be the good old lanczos 3 with maybe AR in very low quality (the banding). here is mpcvr jinc2m https://abload.de/img/jinc2l9ezb.png which is flawless no bands or discontinuities. this just a pattern that roughly tells you the scaler and shows error in it. the band seen in your intel results could be pointless if you are only scaling x2. |
![]() |
![]() |
![]() |
#113 | Link |
Registered User
Join Date: Jun 2020
Posts: 269
|
jinc2m generates a clean pattern on this test, but does tend to oversharpen with real video.
if anyone wants to see what the input test patterns looks like, here's the integer scaling (180x180 pixels) of the first test pattern: ![]() 1080 version: https://github.com/butterw/bShaders/...er/test_resize
__________________
bShaders: realtime Effects/filters for video players Last edited by butterw2; 25th May 2023 at 18:54. Reason: clarity |
![]() |
![]() |
![]() |
#115 | Link |
Registered Developer
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,312
|
The image is not meant to be perfectly upscaled, its meant to visualize properties of upscalers. Of course "integer scaling" (whoever named it that? Its point sampling or nearest neighbour scaling) will look just like a perfectly bigger version of it. But you get aliasing, tons of aliasing. Thats all the sharp corners. Normal images have no sharp corners.
You don't even know if thats what it was supposed to look like. Maybe it was once bigger and had smooth detail, but when downscaling the lack of resolution made it appear to be pixel-y. You totally missed the point of this image and what its supposed to test. "integer scaling" is a pointless excercise with very little real-world use, at best only useful if you play old pixelart games. What the test did show is that whatever upscaler was being used for your original images is terrible. It creates a lot of visible block artifacts around the elements. This may not be visible in normal video because the scaling factor is not as extreme, but its certainly not a great algorithm.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders Last edited by nevcairiel; 25th May 2023 at 14:05. |
![]() |
![]() |
![]() |
#116 | Link |
Registered User
Join Date: Jun 2020
Posts: 269
|
Of course nearest neighbour/integer scaling doesn't perform well for general purpose video. Having the reference is useful to determine that there is a pixel shift of the motif.
The built-in scaler is not great, not terrible. Out of the box, it actually performs slightly better than lanczos3 on my random video test (480p low bitrate + compression artefacts to 1080p). Jinc2m looked very poor there. catrom lacked sharpness. It's going to take some magic to make these videos look good upscaled to 1080p (2-3x upscale), getting a better source is easier.
__________________
bShaders: realtime Effects/filters for video players |
![]() |
![]() |
![]() |
#117 | Link | |
Registered User
Join Date: Oct 2012
Posts: 7,732
|
lowering resolution is a terrible compression algorithm so it unlikely to find a scaler that will make a lower resolution video look constantly or at least for the majority better than higher resolution video.
Quote:
https://abload.de/img/integarscaleri7elz.png pretty sure nvidia also uses that name. it was ask for for about a decade to make pixel art game look normal on rare 1440p displays at the time. pixelart games are usually 720p like FTL. only pascal and newer can do it on nvidia don't ask why. (may have changed not that i care) point and NN where not enough i guess... |
|
![]() |
![]() |
![]() |
#118 | Link |
Registered User
Join Date: Jun 2020
Posts: 269
|
- Integer scaling allows to zoom in to the source pixels as they are (without upscaler effect).
At 200% upscale, the low resolution, bitrate constrained web video that was compressed to look ok at 100% shows it's artefacts. The upscaler has to mitigate this somehow. The most common artefact is noisy edges, from what I observed. To view the available codec/bitrates on a url from a streaming site, you can use a youtube-dl variant from command-line: > yt-dlp.exe -F url When you go from a 480p to a 360p stream you are lowering resolution, but also lowering bitrate, so the upscaling problem becomes a lot harder. From initial testing close-up on a 24" monitor, 720p to 1080p upscale (1.5x) with acceptable quality might be more feasible than 480p to 1080p. but screen display size and viewing distance are key: - upscaling 480p to 720p (1.5x upscale) on the small screen of a smarphone is probably OK. - upscaling 480p to 1080p (2.25x upscale) on a 24" monitor might look OK if you are watching from a distance. - 720p to 1440p monitor would be a 2x upscale. - 720p to 2160p would be a 3x upscale. Web video quality is typically poor to OK (this is NOT a bluray source). Bitrate would typically be in the range 1000-1500kbps for 720p and currently are typ. only available as h264 (with the exception of youtube). What are your current recommandation for realtime upscaling of low bitrate video to 1080p on PC ?
__________________
bShaders: realtime Effects/filters for video players Last edited by butterw2; 28th May 2023 at 14:31. |
![]() |
![]() |
![]() |
#119 | Link |
Registered User
Join Date: Jun 2020
Posts: 269
|
Low resolution web-videos and scaling (fullscreen, 2x, 1.5x, 0.75x), without superResolution
- Scaling low resolution to fullscreen to view on a monitor should probably only be considered if the source is reasonably good. In this case to upscale 720p to 1080p, you just need a sharp resizer or a sharpening shader. Adding noise/grain might help if the source lacks it. - When the source has visible artifacts at 100% zoom, the options are to try to reduce the artifacts or to view downscaled. - Some artifacts can be treated effectively at low cost, but there isn't much built-in to mpc-hc/be to do this. Mpc-hc does offer a 3x3 gaussian blur shader (light spatial smoothing). - In mpc-hc and mpc-be, only 200% and 50% zoom can be easily and directly applied in windowed mode. But often the desirable scaling would be 150% or 75%...
__________________
bShaders: realtime Effects/filters for video players |
![]() |
![]() |
![]() |
#120 | Link | |
Registered User
Join Date: Jun 2020
Posts: 269
|
(custom) windowed zoom: 150%
Quote:
- You can go back to 100% zoom using View > Zoom > 100% or the corresponding hotkey. - mpc-hc and mpc-be do allow to set a fixed window size or remember last window size. But random videos will have different resolutions so this isn't typically practical. - mpc-hc has added a "zoom window +", "zoom window -" hotkey, which would allow to adjust window size manually (! the step is small though). - in fullscreen mode, you could create a custom zoom factor with View>Pan&scan> Edit... preset, with the option to further adjust manually with numpad 9,1, 5 (PnS reset) hotkeys. However Vlc does have the setting I was looking for (custom default windowed zoom): Tools > Preferences > Show Settings: All (at the bottom) to access Advanced Settings. Video > zoom Video: 150%. Restart the player. In mpv: > mpv.exe --no-hidpi-window-scale --window-scale=1.5 "b:\Videos\day_480p.mp4" - mpc-hc Changes from 1.9.1 to 1.9.2: Added a 25% zoom shortcut and menu entry I don't know what the use case for a 25% zoom is, but I would suggest having a user customizable zoom would be more useful. The default value could remain 25%.
__________________
bShaders: realtime Effects/filters for video players Last edited by butterw2; 31st May 2023 at 14:03. Reason: +mpv, 25% zoom ? |
|
![]() |
![]() |
![]() |
Tags |
hlsl, mpc-be, mpc-hc, mpv, pixel shaders |
Thread Tools | Search this Thread |
Display Modes | |
|
|