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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Help] Encoding HDR to SDR
#1
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
Reply
Thanks given by:
#2
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.
Reply
Thanks given by: awsmguy145 , pipefan413
#3
(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.
Reply
Thanks given by:
#4
Yeah, remove "-c:v ffv1 -level 3 -coder 1 -g 1" and replace the codec with -c:v libx264 and whatever options you want.
Reply
Thanks given by: awsmguy145


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Help] Encoding audio with LFE2? LucasGodzilla 9 3,938 2024-06-05, 12:43 AM
Last Post: LucasGodzilla
  Flagging 1080p25 as 1080i25 without re-encoding Dr. Cooper 3 2,254 2021-12-07, 01:14 PM
Last Post: FreaQ
  FFV1 encoding for archival pipefan413 0 1,835 2021-03-11, 07:14 PM
Last Post: pipefan413
Thumbs Up Avisynth parallel encoding spoRv 27 21,830 2020-04-03, 06:10 AM
Last Post: spoRv
  x264 encoding from Adobe Premiere DoomBot 26 21,052 2019-03-25, 08:26 PM
Last Post: jaminmc
  [Help] Encoding issue with Xvid4psp v5.0.37.8 Beber 7 6,170 2018-12-12, 12:40 AM
Last Post: deleted user
  Bitrate and video encoding spoRv 0 3,165 2017-05-01, 11:19 AM
Last Post: spoRv
  Encoding : where to go from here...? Docsap 2 4,261 2017-02-26, 04:42 AM
Last Post: spoRv
  H.265 Encoding PDB 3 4,740 2016-10-18, 08:49 PM
Last Post: Feallan
Lightbulb Splitting the encoding in various phases... spoRv 0 3,283 2015-06-10, 12:41 AM
Last Post: spoRv

Forum Jump:


Users browsing this thread: 1 Guest(s)