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 > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 22nd November 2022, 00:04   #1  |  Link
Qaenos
Registered User
 
Join Date: Oct 2018
Posts: 35
Need Help w AVISynth+ HDR UHD and Intel Arc A770

I had a NVidia GPU and I was successfully opening mkvs taken from UHDs using a combination of DGSource() and DGHDRtoSDR().

I've switched to an Intel Arc A770 discrete GPU and the DGHDRtoSDR no longer works because it needs uses CUDA for HW acceleration.

What do I need to do to open a UHD HDR mkv with AVISynth+ using my Intel A770 for HW acceleration?

Here's an example of the type of file I am trying to open:

Video #1
ID : 4113 (0x1011)
Menu ID : 1 (0x1)
Format : HEVC
Format/Info : High Efficiency Video Coding
Format profile : Main 10@L5.1@High
HDR format : SMPTE ST 2086, HDR10 compatible
Codec ID : 36
Duration : 2 h 13 min
Width : 3 840 pixels
Height : 2 160 pixels
Display aspect ratio : 16:9
Frame rate : 23.976 (24000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0 (Type 2)
Bit depth : 10 bits
Color range : Limited
Color primaries : BT.2020
Transfer characteristics : PQ
Matrix coefficients : BT.2020 non-constant
Mastering display color primar : BT.2020
Mastering display luminance : min: 0.0001 cd/m2, max: 1000 cd/m2
Maximum Content Light Level : 787 cd/m2
Maximum Frame-Average Light Le : 506 cd/m2
Qaenos is offline   Reply With Quote
Old 22nd November 2022, 05:01   #2  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,468
Have you tried LWLibavSource with prefer_hw=2 ?
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 22nd November 2022, 13:05   #3  |  Link
Qaenos
Registered User
 
Join Date: Oct 2018
Posts: 35
Quote:
Originally Posted by Selur View Post
Have you tried LWLibavSource with prefer_hw=2 ?
Yes. I can open the video with LWLibavVideoSource with prefer_hw=2 but I need something to process the HDR. The colors are all washed out when I open it with prefer_hw=2. I used to use DGHDRtoSDR to process the HDR and get the colors to display properly, but without HW acceleration (DGHDRtoSDR only uses NVidia CUDA) it's too slow to use in real-time.

How do I get the HDR colors to display properly in real-time?
Qaenos is offline   Reply With Quote
Old 22nd November 2022, 20:41   #4  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,468
Ah, okay. You are looking for hardware accelerated HDR10 to SDR.
Afaik there is no hardware accelerated HDR10 to SDR for QSV.
-> since I doubt that anybody will write a plugin for it any time soon, saving for a HDR display (like a innocn 27m2u if 60Hz is enough) or a newer NVIDIA card might be your best bet.
(maybe using some 3dlut might work)
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 22nd November 2022, 22:22   #5  |  Link
Qaenos
Registered User
 
Join Date: Oct 2018
Posts: 35
Quote:
Originally Posted by Selur View Post
Ah, okay. You are looking for hardware accelerated HDR10 to SDR.
Afaik there is no hardware accelerated HDR10 to SDR for QSV.
-> since I doubt that anybody will write a plugin for it any time soon, saving for a HDR display (like a innocn 27m2u if 60Hz is enough) or a newer NVIDIA card might be your best bet.
(maybe using some 3dlut might work)
Actually my display is HDR capable. If i just want to play the mkv, i can do it no problem with mpc hc and madvr. However, if i want to manipulate the image (e.g. crop, realize, etc) via AVISynth first, that's where I need something to handle the HDR otherwise everything is washed out.

If my display is HDR can I use AVISnth toanipulate the video and display it with the right colors?
Qaenos is offline   Reply With Quote
Old 23rd November 2022, 02:47   #6  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,445
https://forum.doom9.org/showthread.p...49#post1974149

And anything built against a version of libavformat after those changes should also pick it up. Basically any build of mpv since March (September for the SAR stuff) certainly will.

Not sure if the way LAVFilters communicates with DirectShow requires special handling per media type or if it just carries over whatever libavformat reports, but if it does just work as is, it would only be possible with one of the latest versions, so long as the fork of FFmpeg it uses has those relevant commits (read: v0.77 at the least).

Reading of frame properties in FFmpeg was committed to upstream FFmpeg in February and fixed up in spots into March. SAR and the flags selector was added at the beginning of September. So for general frameprops, at least FFmpeg 5.1. For SAR and the selector, that'll be in the upcoming 5.2 release, whenever that happens. Or just use the git version.

(the side benefit of this, of course, is that you can also override frameprops in the script)



That said, I'm pretty sure that LSMASHSource can't activate QSV decoders on Arc, because I don't see anything about either A) Arc being selectable under the Media SDK that mfx_dispatch supports, or B) LSMASHSource using oneVPL (the successor to the Media SDK that is supposed to work with Arc). This also seems to bear out in actual tests, as Task Manager shows UHD Graphics 630 and prefer_hw=2 using the GPU's Video Decode. On the A770, the graph is empty when using LSMASHSource - even with prefer_hw=2 - while playing the file directly shows Video Decode working.
qyot27 is offline   Reply With Quote
Old 23rd November 2022, 04:13   #7  |  Link
PoeBear
Registered User
 
Join Date: Jan 2017
Posts: 49
DGHDRtoSDR(impl="sw") will run it in software/non-CUDA mode

Alternatively, you could use Cube() and a LUT
PoeBear is offline   Reply With Quote
Reply

Tags
avisynth, avisynth+, hdr, intel, uhd

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 07:20.


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