Converting UHD BD dvhe.07 to dvhe.08 with dovi_tool

MKV playback, recompression, remuxing, codec packs, players, howtos, etc.
nekno
Posts: 56
Joined: Tue Jun 23, 2020 4:40 am

Converting UHD BD dvhe.07 to dvhe.08 with dovi_tool

Post by nekno »

So I have UHD BD backups (Dolby Vision, Profile 7, MEL or FEL) I want to convert to DoVi Profile 8.1 for playback on the Sony X700 via USB using dovi_tool.

This works for two types of source files:
  1. UHD BD M2TS (DTDL dvhe.07)
  2. MKV (STDL dvhe.07)
Steps:
  1. Demux the video and convert the RPU to P8.1
    • If using an mkv file, it's convenient to demux with ffmpeg and convert with dovi_tool in one command:

      Code: Select all

      ffmpeg -i video.mkv -c:v copy -vbsf hevc_mp4toannexb -f hevc - | dovi_tool -m 2 convert --discard -
      The above will:
      • Extract the single BL+EL+RPU video track from the mkv file
      • Convert the RPU to Profile 8.1
      • Discard the EL (which won't be used with Profile 8.1)
      • Write just the BL+RPU to a file named BL_RPU.hevc
      If you used an mkv file as your source, you're done demuxing and converting. You can skip to remuxing your file.
    • If using an m2ts file, you need the BL from one video track and the RPU from the EL+RPU track. It's easiest to first demux the tracks. After that, you can can extract the RPU from the EL and inject it into the BL.
      1. First, demux. There are two easy options for demuxing:
        • Demux both video tracks using tsMuxer in the demux mode.
        • Or, use the following ffmpeg command:

          Code: Select all

          ffmpeg -i uhdbd.m2ts -map 0:v:0 -c:v copy -vbsf hevc_mp4toannexb -f hevc BL.hevc -map 0:v:1 -c:v copy -vbsf hevc_mp4toannexb -f hevc EL_RPU.hevc
      2. Next, extract and convert the RPU from the EL:

        Code: Select all

        dovi_tool -m 2 extract-rpu EL_RPU.hevc -o RPU.bin
      3. Next, inject the RPU into the BL:

        Code: Select all

        dovi_tool inject-rpu -i BL.hevc --rpu-in RPU.bin -o BL_RPU.hevc
  2. Remux into a new .m2ts file or BDMV folder with tsMuxeR:
    • Add the BL_RPU.hevc video
    • If you want a Dolby TrueHD audio track, you can copy it directly from an m2ts file sourced from a UHD BD, because it will include the DD+ core. If your source is an mkv file, you'll want to use eac3to to create a DD+ core and mux it a thd+ac3 track. You'll just ignore the DD core on playback.
    • Add the desired audio, subtitles, chapters, etc, from the original m2ts/mkv file. If using TrueHD from mkv, use the above thd+ac3 audio track instead.
Thus far, I've been successfully using the above to trigger DoVi using the X700 reading from USB while connected to a Vizio P75-F1 and a Sony XRA80J display.


Am I holding this right? Does the above seem like I should be actually getting DoVi dynamic metadata if the display is indicating DoVi?
Last edited by nekno on Thu Mar 10, 2022 7:20 am, edited 2 times in total.
nekno
Posts: 56
Joined: Tue Jun 23, 2020 4:40 am

Re: Converting UHD BD dvhe.07 to dvhe.08 with dovi_tool

Post by nekno »

Did a bit of testing with mkv files, m2ts files, and BDMV folders from USB and over the network on the Sony X700.

The X700 won't play any DoVi profile from an mkv container; everything gets downgraded to HDR10.

DV P7 must use a BDMV folder structure, as expected for the UHD BD spec.

DV P8.1 must use an m2ts or ts container. It may also work with an mp4 container but I haven't finished testing.

Dolby TrueHD audio still requires the DD core track, per the UHD BD spec. Though tsMuxer now supports adding a TrueHD track without a DD core, I could not get the X700 to play the TrueHD audio when it did not have the DD core (either from a BDMV folder on a USB drive or over the network with an m2ts file) .

Code: Select all

╔══════╦════════╦═════════════════════════╦══════╦═════════════╦═════════════════════════╦════════════╦══════════════╦═══════════╗
║ Src  ║ Tracks ║      Source Format      ║ Dest ║ Dest Tracks ║       Dest Format       ║ Sony X700  ║ Vizio P75-F1 ║ Sony A80J ║
╠══════╬════════╬═════════════════════════╬══════╬═════════════╬═════════════════════════╬════════════╬══════════════╬═══════════╣
║ BDMV ║ DTDL   ║ dvhe.07.06, BL, FEL+RPU ║ --   ║ --          ║ --                      ║ DoVi       ║ DoVi         ║ DoVi      ║
║ BDMV ║ DTDL   ║ dvhe.07.06, BL, FEL+RPU ║ BDMV ║ STSL        ║ dvhe.08.06, BL+RPU      ║ HDR        ║ DoVi         ║ HDR       ║
║ MKV  ║ STDL   ║ dvhe.07.06, BL+FEL+RPU  ║ BDMV ║ DTDL        ║ dvhe.07.06, BL, FEL+RPU ║ DoVi       ║ DoVi         ║ DoVi      ║
║ MKV  ║ STDL   ║ dvhe.07.06, BL+FEL+RPU  ║ BDMV ║ STSL        ║ dvhe.08.06, BL+RPU      ║ Won't play ║ --           ║ --        ║
║ MKV  ║ STDL   ║ dvhe.07.06, BL+MEL+RPU  ║ BDMV ║ DTDL        ║ dvhe.07.06, BL, MEL+RPU ║ DoVi       ║ DoVi         ║ DoVi      ║
║ MKV  ║ STDL   ║ dvhe.07.06, BL+MEL+RPU  ║ BDMV ║ STSL        ║ dvhe.08.06, BL+RPU      ║ Won't play ║ --           ║ --        ║
║ BDMV ║ DTDL   ║ dvhe.07.06, BL, FEL+RPU ║ M2TS ║ STSL        ║ dvhe.08.06, BL+RPU      ║ DoVi       ║ DoVi         ║ DoVi      ║
║ BDMV ║ DTDL   ║ dvhe.07.06, BL, MEL+RPU ║ M2TS ║ STSL        ║ dvhe.08.06, BL+RPU      ║ DoVi       ║ DoVi         ║ DoVi      ║
║ MKV  ║ STDL   ║ dvhe.07.06, BL, FEL+RPU ║ M2TS ║ STSL        ║ dvhe.08.06, BL+RPU      ║ DoVi       ║ DoVi         ║ DoVi      ║
║ MKV  ║ STDL   ║ dvhe.07.06, BL, MEL+RPU ║ M2TS ║ STSL        ║ dvhe.08.06, BL+RPU      ║ DoVi       ║ DoVi         ║ DoVi      ║
╚══════╩════════╩═════════════════════════╩══════╩═════════════╩═════════════════════════╩════════════╩══════════════╩═══════════╝
So I'm concluding from the above:
  • If you have a BDMV folder with dvhe.07, just play it directly.
  • If you have an m2ts file with dvhe.07, just remux it to BDMV using tsMuxeR.
    • DTDL dvhe.07.06, BL & EL+RPU will play just fine using a BDMV folder on a USB drive.
    • If you want to stream over a network to the X700, convert the dvhe.07 to dvhe.08 (BL+RPU, dropping the EL).
  • If you have an mkv file with dvhe.07, demux the STDL BL+EL+RPU to BL.hevc & EL.hevc using dovi_tool, then remux it to BDMV using tsMuxeR.
    • For short files, STDL dvhe.07.06, BL+EL+RPU, will play just fine if you remux to m2ts.
    • Long movies will need DTDL dvhe.07.06, BL & FEL+RPU, with a BDMV playlist in order to play back correctly with FF/RW.
    • tsMuxeR won't remux Dolby TrueHD from mkv utilizing a separate track for the AC3 core, so use eac3to to remux the TrueHD audio track with a new AC3 core (which you won't use, but will allow remuxing in tsMuxeR). There doesn't seem to be a way to remux TrueHD with an existing AC3 core from another track in the source mkv file. tsMuxer does now support muxing a TrueHD track without an AC3 core as input, but audio playback doesn't presently work on the X700 in BDMV or m2ts formats when the AC3 core is missing.
  • If you have an mkv file with dvhe.07, you can also drop the EL (which will cost you the quality of the EL for FEL titles but will essentially be a lossless conversion for MEL titles) and convert dvhe.07 STDL BL+EL+RPU to dvhe.08 BL_RPU.hevc using dovi_tool, then remux it to m2ts using tsMuxeR.
    • Same problem with audio support in tsMuxeR, tho, so use eac3to to remux with a new AC3 core, if TrueHD audio is needed.
I also tested all of the above m2ts and mkv files and none of them played on a Panasonic DP-UB820 player with DoVi. All were downgraded to HDR10, wouldn't play, or wouldn't play the audio.
Last edited by nekno on Sun Mar 13, 2022 10:21 pm, edited 1 time in total.
Nuitarius
Posts: 7
Joined: Sun Jun 04, 2017 11:33 am

Re: Converting UHD BD dvhe.07 to dvhe.08 with dovi_tool

Post by Nuitarius »

Can you please help me out with one step in your process.

"Write just the BL+RPU to a file (misnamed) BL_EL.hevc"

How do I do this. What software do I use? MKVToolNix and tsMuxeR do not accept the RPU.bin file so How to I combine those 2 into 1 .hevc file?
Marantz AV8802A, Emotiva XPA-2 GEN3, Emotiva XPA-4 GEN3, Emotiva XPA-5 GEN2
OPPO UD-203, NVIDIA Shield, Sonos Connect, Emby Movie server
2 B&W CM9, 1 B&W CMC2, 4 B&W CM5, 4 B&W CCM662, 1 Funk Audio 18.0
ArArdin
Posts: 195
Joined: Fri Nov 20, 2020 1:40 pm

Re: Converting UHD BD dvhe.07 to dvhe.08 with dovi_tool

Post by ArArdin »

nekno wrote:
Tue May 25, 2021 5:18 am
When using an MKV file as the audio source, tsMuxeR only supports lossy Dolby Digital tracks.
Latest tsMuxer can mux TrueHD only (with or without Atmos). Whether it'll play on your devive is another matter, of course.
nekno
Posts: 56
Joined: Tue Jun 23, 2020 4:40 am

Re: Converting UHD BD dvhe.07 to dvhe.08 with dovi_tool

Post by nekno »

Nuitarius wrote:
Wed Mar 09, 2022 6:15 am
Can you please help me out with one step in your process.

"Write just the BL+RPU to a file (misnamed) BL_EL.hevc"

How do I do this. What software do I use? MKVToolNix and tsMuxeR do not accept the RPU.bin file so How to I combine those 2 into 1 .hevc file?
I updated the process to reflect the different steps if your source if an mkv file vs an m2ts file. I had been using mkv files, so I'd skipped some steps for an m2ts source.

If you're using an mkv file, you just use one command with ffmpeg and dovi_tool to convert it to a BL_RPU.hevc track.

If you're using an m2ts file, follow the new steps in the OP. You'll demux the tracks, extract and convert the RPU from the EL, inject the RPU into the BL (which I think is the primary step you're missing with your RPU.bin file), and then remux the BL+RPU video with your other tracks.
nekno
Posts: 56
Joined: Tue Jun 23, 2020 4:40 am

Re: Converting UHD BD dvhe.07 to dvhe.08 with dovi_tool

Post by nekno »

ArArdin wrote:
Wed Mar 09, 2022 2:12 pm
nekno wrote:
Tue May 25, 2021 5:18 am
When using an MKV file as the audio source, tsMuxeR only supports lossy Dolby Digital tracks.
Latest tsMuxer can mux TrueHD only (with or without Atmos). Whether it'll play on your devive is another matter, of course.
In my testing on the Sony X700, the TrueHD track without the DD core doesn't work when playing an m2ts file (and I assume it won't work with BDMV, either, since it's against the spec), so I left a note in the steps above.
ketav
Posts: 1
Joined: Sun Mar 13, 2022 5:47 am

Re: Converting UHD BD dvhe.07 to dvhe.08 with dovi_tool

Post by ketav »

I was going through your posts so you have concluded that Sony A80J only supports DOVI Profile 5 and 8 and it doesnt support profile 7 ?
I have one file with mediainfo as

Code: Select all

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, dvhe.07.06, BL+EL+RPU, Blu-ray compatible / SMPTE ST 2094 App 4, Version 1, HDR10+ Profile B compatible
Codec ID                                 : V_MPEGH/ISO/HEVC
Duration                                 : 2 h 29 min
Bit rate                                 : 46.6 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.235
Stream size                              : 48.8 GiB (92%)
Title                                    : MPEG-H HEVC Video / 4726 + 41896 kbps / 2160p / 23.976 fps / 16:9 / Main 10 @ Level 5.1 @ High / 10 bits / Dolby Vision + HDR10 / BT.2020
Language                                 : English
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
Maximum Content Light Level              : 1000 cd/m2
Maximum Frame-Average Light Level        : 696 cd/m2
Original source medium                   : Blu-ray
bravia is showing it as HDR not detecting Dovi ?
nekno
Posts: 56
Joined: Tue Jun 23, 2020 4:40 am

Re: Converting UHD BD dvhe.07 to dvhe.08 with dovi_tool

Post by nekno »

ketav wrote:
Sun Mar 13, 2022 5:55 am
I was going through your posts so you have concluded that Sony A80J only supports DOVI Profile 5 and 8 and it doesnt support profile 7 ?

bravia is showing it as HDR not detecting Dovi ?
I was originally testing with the Vizio P75-F1 but switched over to the Sony A80J last year.

The A80J will do TV-led DV where I think the Vizio was only capable of player-led LLDV (not fact checking that to be sure), but both would play any DV profile.

I haven't really been testing the displays or the built-in player in the A80J. I've really been testing the DV compatibility of the Sony X700 as a player of different container formats.

The A80J properly displays DV P5, 7, & 8.

It displays P5 from streaming services from an Apple TV or the built-in Google TV apps.

It displays P7 MEL or FEL from the X700 when playing back a UHD BD or BDMV folder from a USB drive. If you're having problems where it falls back to HDR10 with P7 content, that's probably because you're using the wrong container format (you must use a BDMV folder, not an m2ts, ts, mp4, or mkv file) or the the wrong player (maybe someone has something working with the Nvidia Shield or another device, but P7 is intended solely for BDMV, so you should expect to need a UHD BD player like the X700 with your content formatted in a BDMV folder structure).

It displays P8.1 from an m2ts file played on the X700, which can be done from the network or a USB drive.

So the A80J works for all DV content. It's more about what player or file format you need to use to get the full experience. If you don't care about or don't have titles with P7 FEL, then you can convert P7 to P8.1 using the instructions in the OP and you'll get the same experience as P7 MEL titles.
nekno
Posts: 56
Joined: Tue Jun 23, 2020 4:40 am

Re: Converting UHD BD dvhe.07 to dvhe.08 with dovi_tool

Post by nekno »

I updated the table with the test results from my more recent experiments.

Bottom line, the X700 wants —
  • P7 in DTDL in a BDMV folder on a USB drive.
  • P8.1 in STSL in an m2ts or similar container, over the network or on a USB drive.
  • TrueHD audio still needs an AC3 core.
Nuitarius
Posts: 7
Joined: Sun Jun 04, 2017 11:33 am

Re: Converting UHD BD dvhe.07 to dvhe.08 with dovi_tool

Post by Nuitarius »

I can confirm that P7 and P8 is working on Nvidia Shield
Some people tell me that Plex has it working, but I can personally confirm that Emby has it working. No lag, no stuttering and full DV and Atmos support on MKV container (directly from MakeMKV, and no tampering).

I do not need to convert P7 anymore. Yeah :)

I did get to a process, of converting P7 to P8, that was fairly simple and short, that worked.

1
MakeMKV to BDMV backup (m2ts)

2
tsMuxeR demux video stream from m2ts to hevc (2 hevc stream)
baselayer.hevc, BL (large, 50-100 GB), 4K video
dvlayer.hevc, EL+RPU (small, 100-ish MB), 2K video

3
yusesope from the above separate BL and EL+RPU profile 7 hevc to BL+RPU profile 8 hevc
Download: https://mega.nz/file/mdU00TZR#bCiuGx6-7 ... rjLOOKESeE
Forum about: viewtopic.php?p=85413#p85413

4
MKVToolNix
Add the yusesope video, and add the m2ts original
Deselect the original video, so that the yusesope video will be muxed with the original chapters, audio and subs

Done
Tested with Dune (2021) and verified with MediaInfo and playback on Nvidia Shield and Emby.
Marantz AV8802A, Emotiva XPA-2 GEN3, Emotiva XPA-4 GEN3, Emotiva XPA-5 GEN2
OPPO UD-203, NVIDIA Shield, Sonos Connect, Emby Movie server
2 B&W CM9, 1 B&W CMC2, 4 B&W CM5, 4 B&W CCM662, 1 Funk Audio 18.0
iamse7en
Posts: 1
Joined: Tue Jan 10, 2023 8:45 pm

Re: Converting UHD BD dvhe.07 to dvhe.08 with dovi_tool

Post by iamse7en »

Just wanted to say thank you for this guide! On a mac, had to brew upgrade ffmpeg, download dovi_tool from their github releases page and copy to /usr/local/bin.

Ran the command:

Code: Select all

ffmpeg -i video.mkv -c:v copy -vbsf hevc_mp4toannexb -f hevc - | dovi_tool -m 2 convert --discard -
Remuxed the original with the new BL_RPU.hevc video stream instead, worked like a charm converting Profile 7 to Profile 8.1. Now it can play on my latest AppleTV via Plex.
Shikariiii
Posts: 2
Joined: Sun Jan 22, 2023 3:11 pm

Re: Converting UHD BD dvhe.07 to dvhe.08 with dovi_tool

Post by Shikariiii »

iamse7en wrote:
Tue Jan 10, 2023 9:10 pm
Just wanted to say thank you for this guide! On a mac, had to brew upgrade ffmpeg, download dovi_tool from their github releases page and copy to /usr/local/bin.

Ran the command:

Code: Select all

ffmpeg -i video.mkv -c:v copy -vbsf hevc_mp4toannexb -f hevc - | dovi_tool -m 2 convert --discard -
Remuxed the original with the new BL_RPU.hevc video stream instead, worked like a charm converting Profile 7 to Profile 8.1. Now it can play on my latest AppleTV via Plex.
Hi, I would like some information as I followed the same steps you provided (including the code) on macos but the BL_RPU.hevc file generated strips Dolby Vision completely. When I check the .hevc file via mediainfo, it doesn't show Dolby Vision information/profile anymore. Still muxed using tsMuxer and ran on LG C2 and it just pops up in normal HDR.

I'm using .mkv file as my source.

What am I doing wrong?

ffmpeg is updated to the latest one and downloaded dovi_tool latest release from github.
nekno
Posts: 56
Joined: Tue Jun 23, 2020 4:40 am

Re: Converting UHD BD dvhe.07 to dvhe.08 with dovi_tool

Post by nekno »

MediaInfo doesn't show DV info on a BL+RPU or EL+RPU HEVC stream, in my experience. It just shows "SMPTE ST 2086, HDR10 compatible", so it looks just like an HDR10 file.

The elementary stream needs to be remuxed into a container.

So what does MediaInfo show about your m2ts/ts file remuxed with tsMuxer?
Shikariiii
Posts: 2
Joined: Sun Jan 22, 2023 3:11 pm

Re: Converting UHD BD dvhe.07 to dvhe.08 with dovi_tool

Post by Shikariiii »

nekno wrote:
Mon Jan 23, 2023 5:12 am
MediaInfo doesn't show DV info on a BL+RPU or EL+RPU HEVC stream, in my experience. It just shows "SMPTE ST 2086, HDR10 compatible", so it looks just like an HDR10 file.

The elementary stream needs to be remuxed into a container.

So what does MediaInfo show about your m2ts/ts file remuxed with tsMuxer?
Yeah I found that out after posting on github for dovi_tool. Muxed it into MKV using MKVToolNix and it correctly showed the DV info and also popped Dolby Vision on the TV afterwards.

When I used tsMuxer to mux the HEVC into a .ts or .m2ts, the Mediainfo still showed no DV profile or info and when I converted it into MP4, the TV played it back in normal HDR as well.
hansolo
Posts: 20
Joined: Fri Jun 14, 2019 5:31 am

Re: Converting UHD BD dvhe.07 to dvhe.08 with dovi_tool

Post by hansolo »

I think I haven't seen any discussion about reversing this process? Does it make any sense? Is it possible to convert dvhe.08 source back to UHD BD compatible dvhe.07 (Profile 7 MEL)?
LG BH16NS55 (w/ WH16NS60 1.02MK) in external enclosure
LG BU40N (1.03MK) in external enclosure
Verbatim #43888 (Pioneer BDR-UD04 FW1.14)
Post Reply