Page 3 of 3

Re: 4K HDR: failed to create video decoder on 43x.xx

Posted: Wed Aug 21, 2019 7:14 am
by admin
Bummer. First I'll try to run nVidia decode samples under the new driver.

Re: 4K HDR: failed to create video decoder on 43x.xx

Posted: Thu Aug 22, 2019 11:15 am
by admin
It's all clear now. When 10-bit came along and before nVidia officially supported it, some people discovered that with a little hack you could decode the 10-bit and the driver would downsample it to 8-bit (NV12). The decoder was set up with an NV12 surface and everything worked fine. For DGIndexNV there is a CUDA kernel to convert that NV12 to RGB24 for display.

Now, the 436.02 driver does not support this hack anymore, and the decode surface must be P016 for 10-bit decoding. That is what DGDecodeNV currently does for 10-bit sources with fulldepth=true. To test this, I hacked DGIndexNV to not decode but still allow the stream to be indexed (using one of Guest 2's streams). Then I made a script with DGSource() delivering fulldepth=true. Everything worked fine with 436.02. But of course, fulldepth=false is broken as it still tries to decode with an NV12 surface.

So, I have to redesign things to always decode 10-bit to a P016 surface. There are a couple ways to go and I need to think about it thoroughly. It could take weeks once you add regression testing and documentation.

The good news is that things are understood and it definitely can be fixed. The bad news is that it will take a while.

Re: 4K HDR: failed to create video decoder on 43x.xx

Posted: Thu Aug 22, 2019 2:47 pm
by admin
We need a P016->RGB24 kernel for DGIndexNV. DGSource() can always automatically deliver YV12 or P016 depending on the input stream bit depth (no more fulldepth option).

Re: 4K HDR: failed to create video decoder on 43x.xx

Posted: Thu Aug 22, 2019 4:29 pm
by Guest
Would it be possible to deliver P016 all the time and the user could then use ConvertBits(8) if 8 bit output was desired?

Re: 4K HDR: failed to create video decoder on 43x.xx

Posted: Thu Aug 22, 2019 7:52 pm
by admin
Yes, and there are much better dithering options available when converting with Avsynth+/Vapoursynth.

Re: 4K HDR: failed to create video decoder on 43x.xx

Posted: Thu Aug 22, 2019 11:06 pm
by hydra3333
gonca wrote:
Thu Aug 22, 2019 4:29 pm
Would it be possible to deliver P016 all the time and the user could then use ConvertBits(8) if 8 bit output was desired?
It would be interesting to see if any existing end-user scripts need changing to suit.
From the way you are talking, I suspect not.
Great ! :D

Re: 4K HDR: failed to create video decoder on 43x.xx

Posted: Fri Aug 23, 2019 1:38 am
by Guest 2
admin wrote:
Thu Aug 22, 2019 7:52 pm
Yes, and there are much better dithering options available when converting with Avsynth+/Vapoursynth.
I am thinking about older system that rely mostly on graphic cards to decode/encode media.

Why not to expand functionalities of HDR to SDR CUDA to apply transformation with dithering?

Re: 4K HDR: failed to create video decoder on 43x.xx

Posted: Fri Aug 23, 2019 8:12 am
by admin
hydra3333 wrote:
Thu Aug 22, 2019 11:06 pm
It would be interesting to see if any existing end-user scripts need changing to suit.
Any script that has DGSource() opening a 10-bit stream with explicit or implicit fulldepth=false will need to be changed.

I don't think it is a source filter's job to be doing bit-depth conversions.

Re: 4K HDR: failed to create video decoder on 43x.xx

Posted: Fri Aug 23, 2019 8:13 am
by admin
Guest 2 wrote:
Fri Aug 23, 2019 1:38 am
Why not to expand functionalities of HDR to SDR CUDA to apply transformation with dithering?
Yes, everything is on the table.

Re: 4K HDR: failed to create video decoder on 43x.xx

Posted: Mon Aug 26, 2019 6:37 pm
by admin
Good news guys! I have it coded and working fine under 436.xx. I did it just as earlier described. As expected, the hardest part was getting the P016->RGB24 CUDA kernel working. Debugging is difficult for kernel development; even doing a printf from kernel code is a nightmare. But I got lucky after 6 hours of poking and prodding. ;) I just convert to 8-bit for display by truncating; there's no need for anything fancier for DGIndexNV.

Now I need to regression test and update the documentation. Maybe I can make a slipstream tomorrow.

Re: 4K HDR: failed to create video decoder on 43x.xx

Posted: Mon Aug 26, 2019 7:51 pm
by Guest
That was quick :hat:

Re: 4K HDR: failed to create video decoder on 43x.xx

Posted: Mon Aug 26, 2019 8:17 pm
by admin
My subconscious mind was throwing up a coder's block and I couldn't figure out why. So I doubled up on the lactobacillus reuteri and the fish oil and a divine spark of creative energy blazed within me. :wow:

Thank you bacteria. Thank you fish. You have not lived in vain.

Re: 4K HDR: failed to create video decoder on 43x.xx

Posted: Tue Aug 27, 2019 6:17 am
by Guest 2
admin wrote:
Mon Aug 26, 2019 6:37 pm
I just convert to 8-bit for display by truncating; there's no need for anything fancier for DGIndexNV.
Humble hint for future release: provide path to DGHDRtoSDR in DGIndexNV.ini and use it to display preview when HDR is found using SDR display (vast majority of us, I think). On a second pass, ability to tweak parameters from DGIndexNV interface. And so for all the great CUDA filters you wrote. It would be less consuming than edit a script and preview in VirtualDub or so.
admin wrote:
Mon Aug 26, 2019 6:37 pm
Now I need to regression test and update the documentation. Maybe I can make a slipstream tomorrow.
:bravo:
admin wrote:
Mon Aug 26, 2019 8:17 pm
Thank you bacteria. Thank you fish. You have not lived in vain.
:D LOL

Re: 4K HDR: failed to create video decoder on 43x.xx

Posted: Tue Aug 27, 2019 10:24 am
by admin
Guest 2 wrote:
Tue Aug 27, 2019 6:17 am
Humble hint for future release: provide path to DGHDRtoSDR in DGIndexNV.ini and use it to display preview when HDR is found using SDR display (vast majority of us, I think). On a second pass, ability to tweak parameters from DGIndexNV interface. And so for all the great CUDA filters you wrote. It would be less consuming than edit a script and preview in VirtualDub or so.
Sure it would be great to make DGIndexNV more capable. Similar to your idea, I have in the past thought of making DGIndexNV capable of frame accuracy when the index file is available. Then why not go all the way and allow it to invoke Avisynth/Vapoursynth filters, etc.? Wouldn't want to re-invent avspmod though, or would we?

OK, off to make the slipstream...

Re: 4K HDR: failed to create video decoder on 43x.xx

Posted: Tue Aug 27, 2019 12:01 pm
by admin
Slipstream 183 is released. Thank you again, Guest 2, for notifying us about this matter.

Marking resolved.

Re: 4K HDR: failed to create video decoder on 43x.xx

Posted: Tue Aug 27, 2019 12:03 pm
by Guest 2
admin wrote:
Tue Aug 27, 2019 10:24 am
Wouldn't want to re-invent avspmod though, or would we?
:oops:
admin wrote:
Tue Aug 27, 2019 12:01 pm
Thank you again, Guest 2, for notifying us about this matter.
You are the most welcome. :hat: