Hello guest, if you like this forum, why don't you register? https://forum.fanres.com/member.php?action=register (December 14, 2021) x


[Help] 

Encoding HDR to SDR

3 Replies, 1236 Views

Hello. I have some HDR videos I want to encode into SDR mainly because I don't have any HDR screens and my laptop doesn't like using tools like madvr to change it to SDR while the videos are playing. 

Truth be told, I am completely inept in ffmpeg and stuff like that, plus I've tried RipBot264 and it just does not seem to work on my desktop, even though it does on my laptop. I looked for tutorials and stuff and even went into the 2nd page of Google! Alas, nothing seemed to help me out. 

Now there is the option to completely ignore it and keep watching it with the normal grey look you see normally in MPC-HC but my entire library of files are in SDR and I'd like this one to be SDR as well. I'd love if someone can guide me through this and teach me how to do this. 

(if anyone asks, original codec of the file is HEVC and its fine if its encoded to HEVC or AVC i dont mind)

thank you so much Smile
I make this conversion in two steps.  First, I remux the UHD BD to MKV with MKVToolNix and then tonemap with ffmpeg (the most recent stable version).  (You don't need to understand the settings: you just have to cd to the directory and replace input.mkv with the name of your file.  Or you can rename your file to input.mkv if you prefer.)

Code:
ffmpeg -i input.mkv -an -vf "zscale=t=linear:npl=100,format=gbrpf32le,zscale=p=bt709,tonemap=tonemap=hable,zscale=t=bt709:m=bt709:r=tv,format=yuv420p,scale=1920:1080" -sws_flags sinc -pix_fmt yuv420p -c:v ffv1 -level 3 -coder 1 -g 1 output.mkv

This creates an intermediate ffv1 file called output.mkv.  Then I make a two-pass encoding with x264.  You can go straight from the original file to h.264 if you like, but I prefer to break the process into two stages.
(This post was last modified: 2020-09-26, 10:03 PM by Chewtobacca.)
(2020-09-26, 10:02 PM)Chewtobacca Wrote: I make this conversion in two steps.  First, I remux the UHD BD to MKV with MKVToolNix and then tonemap with ffmpeg (the most recent stable version).  (You don't need to understand the settings: you just have to cd to the directory and replace input.mkv with the name of your file.  Or you can rename your file to input.mkv if you prefer.)

Code:
ffmpeg -i input.mkv -an -vf "zscale=t=linear:npl=100,format=gbrpf32le,zscale=p=bt709,tonemap=tonemap=hable,zscale=t=bt709:m=bt709:r=tv,format=yuv420p,scale=1920:1080" -sws_flags sinc -pix_fmt yuv420p -c:v ffv1 -level 3 -coder 1 -g 1 output.mkv

This creates an intermediate ffv1 file called output.mkv.  Then I make a two-pass encoding with x264.  You can go straight from the original file to h.264 if you like, but I prefer to break the process into two stages.

I'm not too bothered with making a two-pass encode, but to change it straight to a h.264, would I have to change -c:v ffv1 to -c:v libx264 ? Noob question I know but I just started using ffmpeg.
Yeah, remove "-c:v ffv1 -level 3 -coder 1 -g 1" and replace the codec with -c:v libx264 and whatever options you want.

Possibly Related Threads…
Thread Author Replies Views Last Post
  New Tool: Dolby Encoding Engine Wrapper schorman 2 6,284 2022-04-26, 09:12 PM
Last Post: CSchmidlapp
  Flagging 1080p25 as 1080i25 without re-encoding Dr. Cooper 3 543 2021-12-07, 01:14 PM
Last Post: FreaQ
  FFV1 encoding for archival pipefan413 0 980 2021-03-11, 07:14 PM
Last Post: pipefan413
Thumbs Up Avisynth parallel encoding spoRv 27 14,292 2020-04-03, 06:10 AM
Last Post: spoRv
  x264 encoding from Adobe Premiere DoomBot 26 13,239 2019-03-25, 08:26 PM
Last Post: jaminmc
  [Help] Encoding issue with Xvid4psp v5.0.37.8 Beber 7 3,545 2018-12-12, 12:40 AM
Last Post: TomArrow
  Bitrate and video encoding spoRv 0 2,132 2017-05-01, 11:19 AM
Last Post: spoRv
  Encoding : where to go from here...? Docsap 2 2,955 2017-02-26, 04:42 AM
Last Post: spoRv
  H.265 Encoding PDB 3 3,239 2016-10-18, 08:49 PM
Last Post: Feallan
Lightbulb Splitting the encoding in various phases... spoRv 0 2,223 2015-06-10, 12:41 AM
Last Post: spoRv



Users browsing this thread: 1 Guest(s)