Processing UHD rips with Handbrake or other software

Please post here for issues related to UHD discs
Message
Author
EmKayVe
Posts: 22
Joined: Thu Aug 30, 2018 3:59 pm

Re: Processing UHD rips with Handbrake or other software

#46 Post by EmKayVe » Tue Oct 09, 2018 10:33 pm

gereral1 wrote:
Tue Oct 09, 2018 1:52 am
I will make a video on the process. You will need at least 1 terabyte drive. The movie fate and furious was 50gig est. after encode was 17.8 gig est. This included the full untouched dtshd. The conversion to the intermedia codec was 600gig and the export was 600gig. The lut added took 5 sec. The export is 1.5x faster that the realtime playback. The encode was 49fps at rec709 1080p 8bit. The codec held up well. MAdvr pixel shader is the way to go BUT if your tv in your room,phone or other projectors then you want to convert these with this lut. I was not sure if the 23.976 would remain but after muxing mkv the untouched audio is played perfect and no sinc issues. I put some new screenshots on the link redfox. Go to go to work and ill be home in 5 days. Ill upload the lut and the how to video. Then its time to pack up this journey.
Awesome thanks bro! What are gonna do with all that spare time? :)

gereral1
Posts: 118
Joined: Tue Apr 14, 2015 10:50 pm

Re: Processing UHD rips with Handbrake or other software

#47 Post by gereral1 » Sat Oct 13, 2018 2:24 am

Special thanks to imhh1 for updated the thread on teaching you guys the script way step by step to add hdr sdr tone mapping. Takes the mystery out of converting. My methods may be less attractive. As it requires import thru export to get the results as his method is a one encode process. I will still make how to video shortly and you guys can decide which produces a more natural result. Im not out to change anything but to help give users another option as there are many ways to sdr.

Heres the link for guys who want to script this into the encoder.

https://forum.redfox.bz/threads/best-gu ... ost-493149

gereral1
Posts: 118
Joined: Tue Apr 14, 2015 10:50 pm

Re: Processing UHD rips with Handbrake or other software

#48 Post by gereral1 » Sat Nov 17, 2018 11:47 pm

The final video for the 3DLut is released today. Please visit my channel and in the video description is the link to get the 3Dlut for the conversion. This is my last post on HDR. I am moving onto new projects and wish you all well in the future.....peace out

https://www.youtube.com/watch?v=43e4fetHS0M&t=18s

EmKayVe
Posts: 22
Joined: Thu Aug 30, 2018 3:59 pm

Re: Processing UHD rips with Handbrake or other software

#49 Post by EmKayVe » Sun Nov 25, 2018 6:53 pm

gereral1 wrote:
Sat Nov 17, 2018 11:47 pm
The final video for the 3DLut is released today. Please visit my channel and in the video description is the link to get the 3Dlut for the conversion. This is my last post on HDR. I am moving onto new projects and wish you all well in the future.....peace out

https://www.youtube.com/watch?v=43e4fetHS0M&t=18s
Ok awesome. I'll definitely check it out. Thanks for your work on this!

rbelusko
Posts: 3
Joined: Thu May 30, 2019 2:40 pm

Re: Processing UHD rips with Handbrake or other software

#50 Post by rbelusko » Thu May 30, 2019 2:43 pm

shadowNET wrote:
Wed Jan 03, 2018 2:15 am
preserve wrote:Although both have the WCG 2020 color space, the original MakeMKV file has a pixel matrix of yuv420p10 while the Handbrake-converted MKV has a pixel matrix of yuv420p.
I have been able to transcode a file with the command line using ffmpeg using the following. It maintained the BT.2020 colour specs

Image

The command I used was

Code: Select all

ffmpeg -i $inputpath -pix_fmt yuv420p10le -c:v libx265 -preset fast -b:v 50M -x265-params keyint=60:bframes=3:vbv-bufsize=75000:vbv-maxrate=75000:hdr-opt=1:repeat-headers=1:colorprim=bt2020:transfer=smpte-st-2084:colormatrix=bt2020nc:master-display="G(13250,34500)B(7500,3000)R(34000,16000)W P(15635,16450)L(10000000,500)" -c:a aac -b:a 256K -y "$outputpath"
where $inputpath is the input file -c:v libx265 is the video codec -b:v 50M was the video bitrate -c:a aac is the audio codec -b:a 256K is the audio bitrate. and $outputpath is the fullpath to the output file.

As a novice trans-coder it took a lot of time to figure this one out. The file just just under 2 days to trans-code on my CPU. But I thought I would throw this out there for others who wanted to mess with HDR. As far as I can tell it is fully maintained in the output file, but someone please correct me if I am wrong.
Hello,
Thank you for sharing this! It successfully preserved the HDR - I re-processed a clip from "A Star Is Born" which was losing HDR when transcoding via Handbrake on x265.

Question: can someone help me reformat this command to use RF (crf) quality adjustments? I have been unable to figure this out. I want to tweak the output filesize to my likings but I prefer to do RF, not VBR.

Thanks
Bob

rbelusko
Posts: 3
Joined: Thu May 30, 2019 2:40 pm

Re: Processing UHD rips with Handbrake or other software

#51 Post by rbelusko » Wed Aug 28, 2019 12:34 pm

shadowNET wrote:
Wed Jan 03, 2018 2:15 am
preserve wrote:Although both have the WCG 2020 color space, the original MakeMKV file has a pixel matrix of yuv420p10 while the Handbrake-converted MKV has a pixel matrix of yuv420p.
I have been able to transcode a file with the command line using ffmpeg using the following. It maintained the BT.2020 colour specs

Image

The command I used was

Code: Select all

ffmpeg -i $inputpath -pix_fmt yuv420p10le -c:v libx265 -preset fast -b:v 50M -x265-params keyint=60:bframes=3:vbv-bufsize=75000:vbv-maxrate=75000:hdr-opt=1:repeat-headers=1:colorprim=bt2020:transfer=smpte-st-2084:colormatrix=bt2020nc:master-display="G(13250,34500)B(7500,3000)R(34000,16000)W P(15635,16450)L(10000000,500)" -c:a aac -b:a 256K -y "$outputpath"
where $inputpath is the input file -c:v libx265 is the video codec -b:v 50M was the video bitrate -c:a aac is the audio codec -b:a 256K is the audio bitrate. and $outputpath is the fullpath to the output file.

As a novice trans-coder it took a lot of time to figure this one out. The file just just under 2 days to trans-code on my CPU. But I thought I would throw this out there for others who wanted to mess with HDR. As far as I can tell it is fully maintained in the output file, but someone please correct me if I am wrong.
Hi all,
I've been silently following this thread for a while now. I concur that the above FFMPEG statement does work and preserves HDR.
I've even modified the command to use CRF rather than VBR for anyone who is interested:

Code: Select all

ffmpeg -i file.mkv -pix_fmt yuv420p10le -c:v libx265 -preset fast -crf 18 -x265-params keyint=60:bframes=3:vbv-bufsize=75000:vbv-maxrate=75000:hdr-opt=1:repeat-headers=1:colorprim=bt2020:transfer=smpte-st-2084:colormatrix=bt2020nc:master-display="G(13250,34500)B(7500,3000)R(34000,16000)W P(15635,16450)L(10000000,500)" -y file-transcoded.mkv
The code above will transcode a file at CRF 18 with a preset of "fast" and preserve HDR (in my opinion).

The problem I am running into is that the output files are not being tagged correctly and my TV does not flip to HDR mode (by default I leave it in "Auto"). Maybe this has been discussed elsewhere. Can someone tell me how to fix this and/or point me to a solution?

Thank you
Bob

rbelusko
Posts: 3
Joined: Thu May 30, 2019 2:40 pm

Re: Processing UHD rips with Handbrake or other software

#52 Post by rbelusko » Thu Aug 29, 2019 12:40 pm

Hi all,
Follow up to my own post. I have solved this problem and I'd like to share my results in the hopes that it helps someone else who is trying to accomplish the same goal.

The following two FFMPEG commands will transcode a 4K HDR REMUX file into a smaller file, retaining full HDR and your playing device should automatically detect HDR mode (if you have it set for that):

1) - transcode the file to crf18 and preserve HDR data:

Code: Select all

ffmpeg -i input-file.mkv -pix_fmt yuv420p10le -c:v libx265 -preset fast -crf 18 -x265-params keyint=60:bframes=3:vbv-bufsize=75000:vbv-maxrate=75000:hdr-opt=1:repeat-headers=1:colorprim=bt2020:transfer=smpte-st-2084:colormatrix=bt2020nc:master-display="G(13250,34500)B(7500,3000)R(34000,16000)W P(15635,16450)L(10000000,500)" -y "output-file-HDR.mkv"
2) - refresh the HDR metadata so the player will automatically detect HDR mode:

Code: Select all

ffmpeg -i output-file-HDR.mkv -c copy -bsf:v hevc_metadata=colour_primaries=9:transfer_characteristics=16:matrix_coefficients=9 outputfile-HDR10.mkv
This has been working for me. All my source material appears to be HDR10, so I use 'transfer_characteristics=16'.

Along with the solution, I do have a small follow-up question: is there any way to do this in one FFMPEG command?

Thanks!
Bob

bentonkyguy36
Posts: 5
Joined: Thu Mar 05, 2020 8:15 pm

Re: Processing UHD rips with Handbrake or other software

#53 Post by bentonkyguy36 » Tue Mar 10, 2020 7:36 am

I need some help with this topic. I'm new to Handbreak. I'm wanting to get a smaller size from my Makemkv rips. They are UHD HDR rips. I would like too maybe cut the size in half. I want to do the main movie with the main audio. No subtitles. I want too keep the original video size & ratio. Would really like to keep the HDR to. I'm confused on what settings to use. Can someone help me with the settings or maybe a preset file i could use. I want to reduce the file size as much as possible without messing the video quality up or the HDR. Any help will be greatly appreciated. Please keep in mind I'm very new at this lol. Thank you!

Woodstock
Posts: 10312
Joined: Sun Jul 24, 2011 11:21 pm

Re: Processing UHD rips with Handbrake or other software

#54 Post by Woodstock » Tue Mar 10, 2020 1:02 pm

Handbrake still does not properly handle HDR content yet, so it's not going to be a lot of help. HDR is what is referred to as 10- or 12-bit color content, but handbrake only deals with 8-bit color internally.

It's something they're working toward, but it is not there yet.

repers
Posts: 1
Joined: Tue Mar 23, 2021 9:59 pm

Re: Processing UHD rips with Handbrake or other software

#55 Post by repers » Tue Mar 23, 2021 10:07 pm

This could also help some folks here :D
CineEncoder

Cine Encoder is an application that allows to convert media files while preserving HDR metadata. NVENC hardware encoding for NVIDIA video cards is also supported for H265 and H264 modes. The following encoding modes are implemented:

H265 NVENC (8, 10 bit)
H265 (8, 10 bit)
H264 NVENC (8 bit)
H264 (8 bit)
VP9 (8, 10 bit)
DNxHR (8, 10 bit)
ProRes (10 bit)

https://github.com/CineEncoder/cine-encoder/

Image

Tigershark4720
Posts: 5
Joined: Thu Oct 10, 2019 2:32 am

Re: Processing UHD rips with Handbrake or other software

#56 Post by Tigershark4720 » Wed Mar 24, 2021 5:12 pm

Handbrake Previously only had a 8bit pipeline, so you would loose information and the HDR10 tag on movies
the nightly build has a 10 bit pipeline, just turn off all the filters, this is great for anyone like me who likes to use QSV on intel processors

SimonM
Posts: 15
Joined: Wed Nov 18, 2020 8:51 am

Re: Processing UHD rips with Handbrake or other software

#57 Post by SimonM » Thu Mar 25, 2021 4:58 pm

I too successfully ripped a UHD HDR with Hanbrake nightly build and it is recognised as 10-bit HDR on Apple devices (and looks amazing). The encode took forever in software mode, but it works. 10-bit QSV doesn’t appear to be supported yet, at least on the Mac side, and the 8-bit version doesn’t even start. I haven’t tried it in Windows.

Weirdly, I couldn’t find any third-party players that reproduced the results accurately: they looked much less dynamic and darker, crushing shadows. That’s fine though because the file is perfectly compatible on my MacBook and iPhone using QuickTime and the TV apps and doesn’t skip. Even scrubbing is totally smooth and lightning quick on my (not exactly new) Xs Max. That’s pretty impressive for a 19 GB file.

Of course, Apple devices require conversion to AAC, but that’s fine for my needs if you keep the bit-rate high. I wonder why Handbrake doesn’t offer ALAC. It’s open-source now as far as I’m aware. Maybe MP4 doesn’t support it.

Post Reply