Converting HLG HDR Video to PQ HDR Video (HDR10)

I've been trying to convert an HLG video to PQ... thread below continues with findings.
21 Replies
TheDevFreak
TheDevFreakOP5mo ago
Excuse the tag, couldn't find another more relevant one.
TheDevFreak
TheDevFreakOP5mo ago
screengrab of original video playing in MPV https://thisismy.technology/TDF/TOfaZaTu89.jpg screengrab of PQ converted playing in MPV https://thisismy.technology/TDF/QuroZido56.jpg
TheDevFreak
TheDevFreakOP5mo ago
Above converted was achieved with ffmpeg -i input -pix_fmt p010le -c:v hevc_nvenc -b:v 19M -vf zscale=transfer=smpte2084 -to 00:03 testpq.mp4
Flaeri
Flaeri5mo ago
So, you're happy with this? Or do you want to tweak the output a bit? Looking for speedups?
TheDevFreak
TheDevFreakOP5mo ago
-vf zscale=transfer=linear,tonemap=clip,zscale=transfer=smpte2084 https://thisismy.technology/TDF/YerinEVe30.jpg
Flaeri
Flaeri5mo ago
I'd be very careful with clip 😅
TheDevFreak
TheDevFreakOP5mo ago
I think I'm happy with it... lol. will do a longer encode and see what the real rate is... only 1x would be pretty disappointing given i've probably got >6 hours of these to do well I could just go to sleep and have it all be done in the morning i spose 😅
Flaeri
Flaeri5mo ago
instead of clip, look into npl, tonemap filters, desat, peak with tonemap, you might be interested in bt2390 not sure if you're on windows or linux, but opencl has hardware accel for tonemapping, which might work heh
TheDevFreak
TheDevFreakOP5mo ago
yeah im actually on windows since this machine has a 3070 in it
MEE6
MEE65mo ago
GG @TheDevFreak, you just advanced to level 3 !
TheDevFreak
TheDevFreakOP5mo ago
I think I may just settle with the default output from -vf zscale=transfer=smpte2084. Asked around a few friends and most of them seem to actually prefer that to the original without knowing which was the original or not
Flaeri
Flaeri5mo ago
happy to hear it, best of luck :OBSHeart:
TheDevFreak
TheDevFreakOP5mo ago
thanks for the help! It looks like 1x is probably the best i'll get but I can live with that
Flaeri
Flaeri5mo ago
huh.. That seems a bit slow. I know I'm not doing 2160p60, but I am curious what is taking so long 😛 I'm getting around 170fps on 1080p
TheDevFreak
TheDevFreakOP5mo ago
2160p25 to be fair but that is a little odd
Flaeri
Flaeri5mo ago
my guess is its CPU decoded, and thats whats slowing you down
TheDevFreak
TheDevFreakOP5mo ago
source is 2160p25, HEVC, 19Mbps Well I would think thats the slowdown but the other testing I had done (yielding worse results) in nvencc was cpu decoded and getting >=100fps and my cpu is barely being hit; 25% or so
Flaeri
Flaeri5mo ago
1080p decode with cuda hw accel is about 500fps Cpu decode is 380fps CPU decode + zscale about 200fps. soo, Guess I'm wrong. Its probably zscale and copying shit all over the place that is the primary time sink
TheDevFreak
TheDevFreakOP5mo ago
yeahhh probably
Flaeri
Flaeri5mo ago
and yeah, mercy be upon ye if you plan on trying to get libplacebo hardware accelerated via vulkan. That was painful, time consuming, and I failed. Maybe things have changed in the past two years, but I would really not want to try that again 😅
TheDevFreak
TheDevFreakOP5mo ago
ah well; i'll just let it cook. and hope the output quality is good enough... should be fine
Want results from more Discord servers?
Add your server