1 (edited by damienbt 01-06-2021 15:47:07)

Topic: SVP encode HDR10 with hardware acceleration

Hi there,

as far as I understand it is now possible to encode HDR videos. However the HDR metadata isn't getting through while using nvidia HEVC encoding.
Would it be possible to update SVP transcoder to get to use NVEncC instead instead of ffmpeg, as NVEncC handles passthrough of HDR10 metadata
Software encoding takes ages, so I really would like to make it work through nvidia hw encoding

Otherwise this is a great piece of software : 4K HDR plays OK now with most players (mpv/vlc and directshow players), please keep doing a great job!

Regards,
Damien

Re: SVP encode HDR10 with hardware acceleration

> as far as I understand it is now possible to encode HDR videos

only after HDR->SDR conversion

> Would it be possible to update SVP transcoder to get to use NVEncC instead instead of ffmpeg

SVP doesn't use ffmpeg directly but via the mpv's interface (cause we want to pass a video through the Vapoursynth filter)

Re: SVP encode HDR10 with hardware acceleration

Ok thank you Chainik.
The recent progress made using avisynth let us play HDR videos through directshow players, any chance that it may be adapted to the chain MPV/vapoursynth ?

FYI I was one of the ffdshow developers, I tried recently to get it back to the code in order to adapt colorspace conversion to 10bits but there is too much old code to adapt, especially the mmx intrinsics on which rely the colorespace converters (to be upgraded to SSE2 intrinsics) and also to make it compatible to visual studio 2019.... So I gave up for now

Re: SVP encode HDR10 with hardware acceleration

> any chance that it may be adapted to the chain MPV/vapoursynth ?

afaik, there's no maintainer for the mpv's encoding mode...

Re: SVP encode HDR10 with hardware acceleration

BTW the new version have a tone mapping "shader" (in fact, an OpenCL routine) implemented in the Vapoursynth plugin, so both transcoder and SVPcast can now give satisfactory colors w/o using ffmpeg's "tonemap" filter (which is probably better, but _super_ slow).

6 (edited by damienbt 08-06-2021 19:26:41)

Re: SVP encode HDR10 with hardware acceleration

Thanks Chainik but I hesitate between those 2 scenarios :
1/ Keep on pluggin in my PC with external UHD player
2/ converting my UHD discs to SVP+MKV vidéos to avoid plugging in the player and having a ready to play library
I will loose HDR in scenario 2 so I'll stick to scenario 1 for now.
If I understand correctly, MPV should "only" have to passthrough HDR metadata besides the 10 bits colors matrix to the vapoursynth plugin and then to the encoder ?
In the past I played around with mplayer code, it is not too complicated I think as this is a mapping between mplayer arguments with ffmpeg primitives and options...

Re: SVP encode HDR10 with hardware acceleration

> MPV should "only" have to passthrough HDR metadata

yep

8 (edited by damienbt 10-06-2021 13:59:42)

Re: SVP encode HDR10 with hardware acceleration

Hi again,

I took a look on MPV & ffmpeg code : so actually (these are my assertions, I may be wrong)
1/ ffmpeg team is working on passing through HDR metadata (static & dynamic HDR10+/DV) to the encoder (h264/hevc) : https://trac.ffmpeg.org/ticket/7037
As long as this won't be achieved, it won't be possible to transcode with SVP while keeping HDR data (although 10 bits colors encoding is working). They seem to be almost there
2/ Adapt MPV code in the command line arguments to input the right parameters to ffmpeg : this is the easy part once ffmpeg will have done the job

Another approach is to extract and then reinject HDR data in the final file as NVEnC does (open source nvidia encoder) or else ffmpeg + Fastflix tool to reinject https://github.com/cdgriffith/FastFlix/ … /tag/3.4.0

Re: SVP encode HDR10 with hardware acceleration

> They seem to be almost there

yeah, "Opened 3 years ago"... just another 3 years and it'll work! big_smile

Re: SVP encode HDR10 with hardware acceleration

Chainik wrote:

> They seem to be almost there

yeah, "Opened 3 years ago"... just another 3 years and it'll work! big_smile

:-) I agree, except that this time this is just a matter of passthrough. They handle now the 10 bits pipeline correctly and one can submit HDR10 settings manually to the x265 encoder.

I just tested Fastflix with x265 and NvencC : HDR10 metada is preserved in the final video file. So the proof of concept is there.
HDR10+ too but not tested. Dolby vision I'm not sure

11

Re: SVP encode HDR10 with hardware acceleration

Now that ffmpeg 7.0 is out, has anything changed?