Issued with mkv and handbrake

MKV playback, recompression, remuxing, codec packs, players, howtos, etc.
Post Reply
Message
Author
Peterduke
Posts: 31
Joined: Sat Oct 22, 2022 3:26 am

Issued with mkv and handbrake

#1 Post by Peterduke » Sat Feb 01, 2025 3:25 am

I rip the 4k uhd with Makemkv , I open the mkv in and it says profile is Dolby vision 7
I then select HVEC 10bit and no mater what I do it strips the Dolby vision and outposts standard hdr10 and the video results are darker with weird colours. I’m just trying to preserve the Dolby vision however I cant really handle command line tools. I have the latest handbreak and it doesn’t matter if I gpu encode or cpu encode the output loses the Dolby vision.

I’d love to store all of my 4k files on a nas or hard drive but I’ve filled all the hard disks I have and at 50 to 80gb it soon fills up a 8TB nas in no time.

I am not sure if there was a way to shrink them from a bd50 down to a bd25.

I see people that have made 15gb mkv files preserving the Dolby vision I can’t just figure out how to do it. I got a decent intel cpu and a 4060 graphics card so It’s not that my hardware isn’t meeting the requirements for handbrake it’s just not saving the Dolby vision.

I’m not sure which tracks I should be ripping from Makemkv as it shows the same video file 4 times but with less chapters.

H4rd3n
Posts: 10
Joined: Mon Oct 24, 2022 7:17 am

Re: Issued with mkv and handbrake

#2 Post by H4rd3n » Sat Feb 01, 2025 9:48 am

How about your other Hardware, does your monitor/TV support DoVi? Do you intend to use MPC-HC with the MPC-Renderer? If one of those is a no for you, you simply can ignore Dolby Vision, because everything else ignores it and just plays the standard HDR10(+) anyways (VLC, MadVR Renderer).

Handbrake cannot handle DoVi, you need to use a dovi-tool. There's one with easy to use batch/command-files for the terminal/Powershell. I don't know, if I may link or upload anything regarding DoVi, so you have to search the internet yourself.

With the tool and batch files you open two explorer windows, one with the batch files, one with the original video file, then drag the video file over to the extractor batch file, this will run it and all you have to do, are some settings, like crop, if you want to remove the black bars from the video. After recoding the video, you copy the RPU, which should be in a subfolder of your original video folder, to the folder, where you have the encoded video and drag that video file to the injector batch file, it will look for the RPU, check the borders (black bars removed?) and inject the encoded video with the DoVi RPU informations. Make sure to check mux into mkv. And make sure, you have enough space on your drive.

But there is one thing, you might not get full DoVi videos, because if you crop it, you cannot add the EL (extended layer, which is a hidden full-HD video track of noise, if you will). A buddy told me, a Video I made was not DoVi compatible, maybe because of that, I cannot test it, because I don't own any devices capable of DoVi. If you don't crop, you should be able to add both, EL+RPU and create a fully compatible video file.

You may want to keep the original HDR informations, so other players not capable of DoVi will show correct colors. I don't really know, if Handbrake is the best tool for the job, I use fastflix.
The final file should look like this in mediainfo:
mediainfoDoVi.png
mediainfoDoVi.png (38.31 KiB) Viewed 691 times

dcoke22
Posts: 3394
Joined: Wed Jul 22, 2020 11:25 pm

Re: Issued with mkv and handbrake

#3 Post by dcoke22 » Sat Feb 01, 2025 7:28 pm

Handbrake documentation: https://handbrake.fr/docs/en/1.9.0/technical/hdr.html

According to the documentation for the latest version of Handbrake, version 1.9.0, if you want to preserve Dolby Vision and the other HDR formats, the only encoders that can do it are the 10-bit versions of x265, SVT-AV1, and Apple VideoToolbox HEVC.

Since you're not running on a Mac, you can't use Apple VideoToolbox HEVC, which is Apple's hardware accelerated encoder. That leaves x265 and SVT-AV1. I don't have much experience with AV1 because I don't have many clients that can decode it therefore I don't encode anything with it.

With Handbrake, I have used the 10-bit, x265 encoder to preserve the HDR a few titles. For instance, starting with this 4k file:

Code: Select all

Video
ID                                       : 1
ID in the original source medium         : 4113 (0x1011)
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L5.1@High
HDR format                               : Dolby Vision, Version 1.0, Profile 7.6, dvhe.07.06, BL+EL+RPU, no metadata compression, Blu-ray compatible / SMPTE ST 2086, Version HDR10, HDR10 compatible
Codec ID                                 : V_MPEGH/ISO/HEVC
Duration                                 : 1 h 43 min
Bit rate                                 : 84.1 Mb/s
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0 (Type 2)
Bit depth                                : 10 bits
Bits/(Pixel*Frame)                       : 0.423
Stream size                              : 60.8 GiB (96%)
Language                                 : English
Default                                  : No
Forced                                   : No
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : Display P3
Mastering display luminance              : min: 0.0001 cd/m2, max: 1000 cd/m2
Original source medium                   : Blu-ray
after encoding (and choosing to resize it down to a 1080p file) I ended up with:

Code: Select all

Video
ID                                       : 1
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L5@High
HDR format                               : Dolby Vision, Version 1.0, Profile 8.1, dvhe.08.03, BL+RPU, no metadata compression, HDR10 compatible / SMPTE ST 2086, Version HDR10, HDR10 compatible / SMPTE ST 2086, Version HDR10, HDR10 compatible
Codec ID                                 : V_MPEGH/ISO/HEVC
Duration                                 : 1 h 43 min
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0 (Type 2)
Bit depth                                : 10 bits
Writing library                          : x265 4.1+1-1d117be:[Mac OS X][clang 16.0.0][64 bit] 10bit
Encoding settings                        : frame-threads=8 / wpp / no-pmode / no-pme / no-psnr / no-ssim / log-level=2 / input-csp=1 / input-res=1920x1080 / interlace=0 / total-frames=0 / level-idc=0 / high-tier=1 / uhd-bd=0 / ref=3 / no-allow-non-conformance / repeat-headers / annexb / aud / no-eob / no-eos / hrd / info / hash=0 / temporal-layers=0 / open-gop / min-keyint=24 / keyint=240 / gop-lookahead=0 / bframes=4 / b-adapt=2 / b-pyramid / bframe-bias=0 / rc-lookahead=20 / lookahead-slices=6 / scenecut=40 / no-hist-scenecut / radl=0 / no-splice / no-intra-refresh / ctu=64 / min-cu-size=8 / no-rect / no-amp / max-tu-size=32 / tu-inter-depth=1 / tu-intra-depth=1 / limit-tu=0 / rdoq-level=0 / dynamic-rd=0.00 / no-ssim-rd / signhide / no-tskip / nr-intra=0 / nr-inter=0 / no-constrained-intra / strong-intra-smoothing / max-merge=3 / limit-refs=1 / no-limit-modes / me=1 / subme=2 / merange=57 / temporal-mvp / no-frame-dup / no-hme / weightp / no-weightb / no-analyze-src-pics / deblock=0:0 / sao / no-sao-non-deblock / rd=3 / selective-sao=4 / early-skip / rskip / no-fast-intra / no-tskip-fast / no-cu-lossless / b-intra / no-splitrd-skip / rdpenalty=0 / psy-rd=2.00 / psy-rdoq=0.00 / no-rd-refine / no-lossless / cbqpoffs=0 / crqpoffs=0 / rc=abr / bitrate=4000 / qcomp=0.60 / qpstep=4 / stats-write=0 / stats-read=2 / cplxblur=20.0 / qblur=0.5 / vbv-maxrate=70000 / vbv-bufsize=70000 / vbv-init=0.9 / min-vbv-fullness=50.0 / max-vbv-fullness=80.0 / ipratio=1.40 / pbratio=1.30 / aq-mode=2 / aq-strength=1.00 / cutree / zone-count=0 / no-strict-cbr / qg-size=32 / no-rc-grain / qpmax=69 / qpmin=0 / no-const-vbv / sar=1 / overscan=0 / videoformat=5 / range=0 / colorprim=9 / transfer=16 / colormatrix=9 / chromaloc=1 / chromaloc-top=2 / chromaloc-bottom=2 / display-window=0 / master-display=G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,1) / cll=0,0 / min-luma=0 / max-luma=1023 / log2-max-poc-lsb=8 / vui-timing-info / vui-hrd-info / slices=1 / no-opt-qp-pps / no-opt-ref-list-length-pps / no-multi-pass-opt-rps / scenecut-bias=0.05 / no-opt-cu-delta-qp / no-aq-motion / hdr10 / hdr10-opt / no-dhdr10-opt / no-idr-recovery-sei / analysis-reuse-level=0 / analysis-save-reuse-level=0 / analysis-load-reuse-level=0 / scale-factor=0 / refine-intra=0 / refine-inter=0 / refine-mv=1 / refine-ctu-distortion=0 / no-limit-sao / ctu-info=0 / no-lowpass-dct / refine-analysis-type=0 / copy-pic=1 / max-ausize-factor=1.0 / no-dynamic-refine / no-single-sei / no-hevc-aq / no-svt / no-field / qp-adaptation-range=1.00 / scenecut-aware-qp=0conformance-window-offsets / right=0 / bottom=0 / decoder-max-rate=0 / no-vbv-live-multi-pass / no-mcstf / no-sbrc / no-frame-rc
Default                                  : Yes
Forced                                   : No
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : Display P3
Mastering display luminance              : min: 0.0001 cd/m2, max: 1000 cd/m2
The key thing to notice is the DV started at:
Dolby Vision, Version 1.0, Profile 7.6, dvhe.07.06, BL+EL+RPU, no metadata compression, Blu-ray compatible / SMPTE ST 2086, Version HDR10, HDR10 compatible
and was converted to:
Dolby Vision, Version 1.0, Profile 8.1, dvhe.08.03, BL+RPU, no metadata compression, HDR10 compatible / SMPTE ST 2086, Version HDR10, HDR10 compatible / SMPTE ST 2086, Version HDR10, HDR10 compatible

which is exactly what the documentation said it would do. It converted the base layer to 8.1 and threw away the enhancement layer. Maybe that's okay for you and maybe it isn't, but it is what Handbrake will do, currently.

As H4rd3n mentioned, if that isn't what you want to happen, there's a giant thread, Dolby Vision now possible through MP4 Mux. that talks about how to use dovi-tool and all kinds of things related. The best way to read that thread, probably, is to start at the most recent post and read backwards until you understand. That way you end up with the most current data and tools.

Coopervid
Posts: 2348
Joined: Tue Feb 19, 2019 10:32 pm

Re: Issued with mkv and handbrake

#4 Post by Coopervid » Sat Feb 01, 2025 8:31 pm

The most important thing is: What is your playback device?

If you still run those files from a burned disc you should check DVDFab or CloneBD to shrink preserving DoVi. And rip to ISO or folder not to MKV. Both need to be purchased. I myself just rip to ISO and play it with an Oppo clone M9702. The most recent variant is the M9201 with the same functionality.

Peterduke
Posts: 31
Joined: Sat Oct 22, 2022 3:26 am

Re: Issued with mkv and handbrake

#5 Post by Peterduke » Thu Feb 06, 2025 6:12 am

Firstly my tv supports Dolby vision if I play the pure rip in kodi it pops up to confirm that Dolby vision video file is playing.

If I compress using 4k Mkv setting it won’t preserve the Dolby vision,

However today I learned that it you select the HQ 4k Hvec x265 and select AC3 as the audio it will preserve the Dolby vision but from my understanding it doesn’t fully preserve the Dolby vision and only seeks to work for me if converting to MP4 format and using CPU encoding, if I use GPU encoding it just converts it to hdr10

Peterduke
Posts: 31
Joined: Sat Oct 22, 2022 3:26 am

Re: Issued with mkv and handbrake

#6 Post by Peterduke » Thu Feb 06, 2025 6:34 am

Coopervid wrote:
Sat Feb 01, 2025 8:31 pm
The most important thing is: What is your playback device?

If you still run those files from a burned disc you should check DVDFab or CloneBD to shrink preserving DoVi. And rip to ISO or folder not to MKV. Both need to be purchased. I myself just rip to ISO and play it with an Oppo clone M9702. The most recent variant is the M9201 with the same functionality.
I play back on my tv from a usb hard drive using Kodi which plays the un compressed rips with Dolby vision enabled, I own Makemkv and mainly rip the 4k with DV as a backup

Post Reply