Dolby Vision now possible through MP4 Mux.

Please post here for issues related to UHD discs
Post Reply
ATD555
Posts: 45
Joined: Fri Feb 28, 2020 4:04 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by ATD555 »

deadchip12 wrote: Tue Mar 10, 2020 2:44 am
ATD555 wrote: Mon Mar 09, 2020 4:27 pm
deadchip12 wrote: Mon Mar 09, 2020 11:25 am Could someone pls summarize what has just been discussed in the last couple of pages? Is there a new method of muxing dolby vision? What are the advantages over the original method in the 1st page? Thanks.
I will try my best.

The method at the beginning of this thread was either using DVDFab or two HEVCs from the video and remuxing it into an MP4 container using Dolby's remuxer. Users reported that DVDFab coloring was incorrect but there was really no choice if they wanted to play Dolby Vision (Single Layer) on devices other than Oppo 203 or Oppo 205 or some LG OLED TVs. It was then discovered that if you remuxed the .m2ts files from the UHD Disc Rips to .ts you can play this file (Dual Layer Dolby Vision) on the Sony x700 UBP Blu-ray Player with all audio profiles present on the disc. The user 'yusesope' then created a tool to create a proper single layer HEVC file from the two HEVCs in the original video file that retains all of the proper colors etc. into a single layer Dolby Vision. You can now use his tool + TSMuxer to make a .ts file that will play on other Dolby Vision capable devices as well as retaining all of the audio profiles from the original video file.

Hopefully this is a decent breakdown of what happened.

Edit: It will also save you money since you no longer need to use DVDFab which is a fairly expensive program.
Thanks for the summary.

I guess for users like me who don’t need the original audio it’s not necessary to use the new tool then?
Well what machine are you playing your videos on?
box4m
Posts: 68
Joined: Tue Sep 10, 2019 7:23 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by box4m »

smartrobot wrote: Fri Mar 06, 2020 4:35 am Is anyone else having this issue with @yusesope tool
Throws an error and hangs the video works it is just missing the last second or so

I can still use the output and create a mp4 using dlb_mp4base and will play back on my Visio TV

FFMPEG output warnings

Code: Select all

[NULL @ 0x5568201f5c80] Invalid NAL unit 36, skipping.
[NULL @ 0x5568201f6e40] Invalid NAL unit 36, skipping.
yusesope output

Code: Select all

___@little-server:~/src$ python3 bl_el_rpu_builder.py -tbw 4 -bl ~/BL.hevc -el ~/EL.hevc -o ~/Out.hvec
Exception in thread Thread-1:LYSIS: 86.8%     BL_EL_RPU WRITING: 86.0%
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "bl_el_rpu_builder.py", line 175, in run
    self.read()
  File "bl_el_rpu_builder.py", line 163, in read
    self.get_nal_info(mm,length,global_offset)
  File "bl_el_rpu_builder.py", line 138, in get_nal_info
    nal_type = self.get_nal_type(mmap_obj[(nal_offset + 3):(nal_offset + 5)])
  File "bl_el_rpu_builder.py", line 128, in get_nal_type
    nuh_layer_id = b_stream.read('uint:6')
  File "/home/nick/.local/lib/python3.6/site-packages/bitstring.py", line 3902, in read
    value, self._pos = self._readtoken(name, self._pos, length)
  File "/home/nick/.local/lib/python3.6/site-packages/bitstring.py", line 2016, in _readtoken
    "Tried to read {0} bits when only {1} available.".format(int(length), self.length - pos))
bitstring.ReadError: Reading off the end of the data. Tried to read 6 bits when only 1 available.

Exception in thread Thread-2:LYSIS: 92.4%     BL_EL_RPU WRITING: 91.3%
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "bl_el_rpu_builder.py", line 175, in run
    self.read()
  File "bl_el_rpu_builder.py", line 163, in read
    self.get_nal_info(mm,length,global_offset)
  File "bl_el_rpu_builder.py", line 138, in get_nal_info
    nal_type = self.get_nal_type(mmap_obj[(nal_offset + 3):(nal_offset + 5)])
  File "bl_el_rpu_builder.py", line 128, in get_nal_type
    nuh_layer_id = b_stream.read('uint:6')
  File "~/.local/lib/python3.6/site-packages/bitstring.py", line 3902, in read
    value, self._pos = self._readtoken(name, self._pos, length)
  File "~/.local/lib/python3.6/site-packages/bitstring.py", line 2016, in _readtoken
    "Tried to read {0} bits when only {1} available.".format(int(length), self.length - pos))
bitstring.ReadError: Reading off the end of the data. Tried to read 6 bits when only 1 available.

BL ANALYSIS: 99.3%     EL ANALYSIS: 99.3%     BL_EL_RPU WRITING: 99.3%

did you ever get this working?
Arbigator
Posts: 32
Joined: Fri Feb 28, 2020 9:16 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by Arbigator »

I've tried three different movies now with yusesope's tool, but I still only get HDR playback on the 2019 Shield. I'm not sure what's going wrong. The sample mp4s worked fine, so I feel like it's something to do with tsMuxer. Here's my workflow: take the m2ts and demux the BL, the EL, and the audio track in tsMuxer. Use yusesope's tool to combine the BL and EL, take the resulting HEVC file and the audio track and mux to ts using tsMuxer.

Am I missing something? Should I be doing something differently?

To those of you using a Shield, which version of tsMuxer are you using? Are there any other settings in tsMuxer I should be changing?

Thanks
deadchip12
Posts: 385
Joined: Thu May 02, 2019 2:49 am

Re: Dolby Vision now possible through MP4 Mux.

Post by deadchip12 »

ATD555 wrote: Tue Mar 10, 2020 4:18 am
deadchip12 wrote: Tue Mar 10, 2020 2:44 am
ATD555 wrote: Mon Mar 09, 2020 4:27 pm

I will try my best.

The method at the beginning of this thread was either using DVDFab or two HEVCs from the video and remuxing it into an MP4 container using Dolby's remuxer. Users reported that DVDFab coloring was incorrect but there was really no choice if they wanted to play Dolby Vision (Single Layer) on devices other than Oppo 203 or Oppo 205 or some LG OLED TVs. It was then discovered that if you remuxed the .m2ts files from the UHD Disc Rips to .ts you can play this file (Dual Layer Dolby Vision) on the Sony x700 UBP Blu-ray Player with all audio profiles present on the disc. The user 'yusesope' then created a tool to create a proper single layer HEVC file from the two HEVCs in the original video file that retains all of the proper colors etc. into a single layer Dolby Vision. You can now use his tool + TSMuxer to make a .ts file that will play on other Dolby Vision capable devices as well as retaining all of the audio profiles from the original video file.

Hopefully this is a decent breakdown of what happened.

Edit: It will also save you money since you no longer need to use DVDFab which is a fairly expensive program.
Thanks for the summary.

I guess for users like me who don’t need the original audio it’s not necessary to use the new tool then?
Well what machine are you playing your videos on?
LG Oled C9 via external hdd.

One question though: Gemini man dolby vision does not play at the correct 60 fps using the original method (remux two HEVCs layers into an MP4 container using mp4muxer). Will it play correctly using the new method (remux two HEVCs layers into an .ts container using yusesope's tool)?
ATD555
Posts: 45
Joined: Fri Feb 28, 2020 4:04 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by ATD555 »

deadchip12 wrote: Tue Mar 10, 2020 9:40 am
ATD555 wrote: Tue Mar 10, 2020 4:18 am
deadchip12 wrote: Tue Mar 10, 2020 2:44 am

Thanks for the summary.

I guess for users like me who don’t need the original audio it’s not necessary to use the new tool then?
Well what machine are you playing your videos on?
LG Oled C9 via external hdd.

One question though: Gemini man dolby vision does not play at the correct 60 fps using the original method (remux two HEVCs layers into an MP4 container using mp4muxer). Will it play correctly using the new method (remux two HEVCs layers into an .ts container using yusesope's tool)?
You should try using TSMuxer and just throw the original video file in it and remux to a .ts using this build of TSMuxer: https://drive.google.com/open?id=1Gq5TA ... B1io4OwHW9
smartrobot
Posts: 4
Joined: Sun Oct 28, 2018 9:44 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by smartrobot »

Okay I have an update to fix the error:
"Reading off the end of the data. Tried to read 6 bits when only 1 available"
and fails at "BL ANALYSIS: 99.0% EL ANALYSIS: 98.8% BL_EL_RPU WRITING: 99.0%"

The problem seems to be the duration of the video clip.
I was able to fix with a hex editor but did not understand the underlying cause.
I finally found the cause to be the length of the clip.

Here are the steps to resolve this.

Step one: find the length of the file using ffprobe

Code: Select all

ffprobe -i ~/Desktop/00022.m2ts
output:
Image

The duration of my media is 00:02:53.98 this will not work with the tool
There either needs to be no decimal or one with 2 even numbers.
The max duration could only be 00:02:53.88

Now using ffmpeg

Code: Select all

ffmpeg -i ~/Desktop/00022.m2ts -map 0:0 -ss 00:00:00 -to 00:02:53.88 -c copy ~/Desktop/BL.hevc
ffmpeg -i ~/Desktop/00022.m2ts -map 0:1 -ss 00:00:00 -to 00:02:53.88 -c copy ~/Desktop/EL.hevc
Now run it through @yusesope's tool without errors

Profit
box4m wrote: Tue Mar 10, 2020 5:53 am
smartrobot wrote: Fri Mar 06, 2020 4:35 am Is anyone else having this issue with @yusesope tool
Throws an error and hangs the video works it is just missing the last second or so

I can still use the output and create a mp4 using dlb_mp4base and will play back on my Visio TV

FFMPEG output warnings

Code: Select all

[NULL @ 0x5568201f5c80] Invalid NAL unit 36, skipping.
[NULL @ 0x5568201f6e40] Invalid NAL unit 36, skipping.
yusesope output

Code: Select all

___@little-server:~/src$ python3 bl_el_rpu_builder.py -tbw 4 -bl ~/BL.hevc -el ~/EL.hevc -o ~/Out.hvec
Exception in thread Thread-1:LYSIS: 86.8%     BL_EL_RPU WRITING: 86.0%
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "bl_el_rpu_builder.py", line 175, in run
    self.read()
  File "bl_el_rpu_builder.py", line 163, in read
    self.get_nal_info(mm,length,global_offset)
  File "bl_el_rpu_builder.py", line 138, in get_nal_info
    nal_type = self.get_nal_type(mmap_obj[(nal_offset + 3):(nal_offset + 5)])
  File "bl_el_rpu_builder.py", line 128, in get_nal_type
    nuh_layer_id = b_stream.read('uint:6')
  File "/home/nick/.local/lib/python3.6/site-packages/bitstring.py", line 3902, in read
    value, self._pos = self._readtoken(name, self._pos, length)
  File "/home/nick/.local/lib/python3.6/site-packages/bitstring.py", line 2016, in _readtoken
    "Tried to read {0} bits when only {1} available.".format(int(length), self.length - pos))
bitstring.ReadError: Reading off the end of the data. Tried to read 6 bits when only 1 available.

Exception in thread Thread-2:LYSIS: 92.4%     BL_EL_RPU WRITING: 91.3%
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "bl_el_rpu_builder.py", line 175, in run
    self.read()
  File "bl_el_rpu_builder.py", line 163, in read
    self.get_nal_info(mm,length,global_offset)
  File "bl_el_rpu_builder.py", line 138, in get_nal_info
    nal_type = self.get_nal_type(mmap_obj[(nal_offset + 3):(nal_offset + 5)])
  File "bl_el_rpu_builder.py", line 128, in get_nal_type
    nuh_layer_id = b_stream.read('uint:6')
  File "~/.local/lib/python3.6/site-packages/bitstring.py", line 3902, in read
    value, self._pos = self._readtoken(name, self._pos, length)
  File "~/.local/lib/python3.6/site-packages/bitstring.py", line 2016, in _readtoken
    "Tried to read {0} bits when only {1} available.".format(int(length), self.length - pos))
bitstring.ReadError: Reading off the end of the data. Tried to read 6 bits when only 1 available.

BL ANALYSIS: 99.3%     EL ANALYSIS: 99.3%     BL_EL_RPU WRITING: 99.3%

did you ever get this working?
mrhollywood
Posts: 16
Joined: Thu May 02, 2019 7:01 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by mrhollywood »

ATD555 wrote: Tue Mar 10, 2020 2:37 pm
deadchip12 wrote: Tue Mar 10, 2020 9:40 am
ATD555 wrote: Tue Mar 10, 2020 4:18 am

Well what machine are you playing your videos on?
LG Oled C9 via external hdd.

One question though: Gemini man dolby vision does not play at the correct 60 fps using the original method (remux two HEVCs layers into an MP4 container using mp4muxer). Will it play correctly using the new method (remux two HEVCs layers into an .ts container using yusesope's tool)?
You should try using TSMuxer and just throw the original video file in it and remux to a .ts using this build of TSMuxer: https://drive.google.com/open?id=1Gq5TA ... B1io4OwHW9
I have a C9, and .ts files do not work (at least with the internal emby app)
ATD555
Posts: 45
Joined: Fri Feb 28, 2020 4:04 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by ATD555 »

mrhollywood wrote: Tue Mar 10, 2020 3:36 pm
ATD555 wrote: Tue Mar 10, 2020 2:37 pm
deadchip12 wrote: Tue Mar 10, 2020 9:40 am

LG Oled C9 via external hdd.

One question though: Gemini man dolby vision does not play at the correct 60 fps using the original method (remux two HEVCs layers into an MP4 container using mp4muxer). Will it play correctly using the new method (remux two HEVCs layers into an .ts container using yusesope's tool)?
You should try using TSMuxer and just throw the original video file in it and remux to a .ts using this build of TSMuxer: https://drive.google.com/open?id=1Gq5TA ... B1io4OwHW9
I have a C9, and .ts files do not work (at least with the internal emby app)
Try the built in player that LG made
mrhollywood
Posts: 16
Joined: Thu May 02, 2019 7:01 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by mrhollywood »

ATD555 wrote: Tue Mar 10, 2020 5:00 pm
mrhollywood wrote: Tue Mar 10, 2020 3:36 pm
ATD555 wrote: Tue Mar 10, 2020 2:37 pm

You should try using TSMuxer and just throw the original video file in it and remux to a .ts using this build of TSMuxer: https://drive.google.com/open?id=1Gq5TA ... B1io4OwHW9
I have a C9, and .ts files do not work (at least with the internal emby app)
Try the built in player that LG made
As far as I'm aware all the apps like plex/emby are just front-ends for the internal player, so loading it off a hard drive shouldn't make much difference.
Arbigator
Posts: 32
Joined: Fri Feb 28, 2020 9:16 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by Arbigator »

mrhollywood wrote: Tue Mar 10, 2020 5:40 pm
ATD555 wrote: Tue Mar 10, 2020 5:00 pm
mrhollywood wrote: Tue Mar 10, 2020 3:36 pm

I have a C9, and .ts files do not work (at least with the internal emby app)
Try the built in player that LG made
As far as I'm aware all the apps like plex/emby are just front-ends for the internal player, so loading it off a hard drive shouldn't make much difference.
I have a B9, and haven't been able to get any .ts files to play through the TV's player, or other apps.


Can anyone with a Nvidia Shield upload a working sample DV .ts file? I've tried multiple movies, and multiple different builds of tsMuxer, but all of them will only activate HDR. Thank you.
shawnc22
Posts: 637
Joined: Tue Jan 21, 2020 7:40 am

Re: Dolby Vision now possible through MP4 Mux.

Post by shawnc22 »

Arbigator wrote: Tue Mar 10, 2020 5:51 pm
mrhollywood wrote: Tue Mar 10, 2020 5:40 pm
ATD555 wrote: Tue Mar 10, 2020 5:00 pm

Try the built in player that LG made
As far as I'm aware all the apps like plex/emby are just front-ends for the internal player, so loading it off a hard drive shouldn't make much difference.
I have a B9, and haven't been able to get any .ts files to play through the TV's player, or other apps.


Can anyone with a Nvidia Shield upload a working sample DV .ts file? I've tried multiple movies, and multiple different builds of tsMuxer, but all of them will only activate HDR. Thank you.
The sample posted here: viewtopic.php?f=12&t=18602&start=1485#p85786 activates DV and Atmos on the Shield. Have you tried opening your files in mediainfo to see what's listed?
Arbigator
Posts: 32
Joined: Fri Feb 28, 2020 9:16 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by Arbigator »

shawnc22 wrote: Tue Mar 10, 2020 6:49 pm
The sample posted here: viewtopic.php?f=12&t=18602&start=1485#p85786 activates DV and Atmos on the Shield. Have you tried opening your files in mediainfo to see what's listed?
Thanks for that link, that file plays back correctly. Oddly enough, I hadn't looked at the mediainfo. Doing so now, the files I created show this for the video: SMPTE ST 2094 App 4, Version 1, HDR10+ Profile B compatible

None of them show Dolby Vision in mediainfo, not even the HEVC file output by yusesope's tool... I guess something is going wrong there then?
shawnc22
Posts: 637
Joined: Tue Jan 21, 2020 7:40 am

Re: Dolby Vision now possible through MP4 Mux.

Post by shawnc22 »

Arbigator wrote: Tue Mar 10, 2020 7:20 pm
shawnc22 wrote: Tue Mar 10, 2020 6:49 pm
The sample posted here: viewtopic.php?f=12&t=18602&start=1485#p85786 activates DV and Atmos on the Shield. Have you tried opening your files in mediainfo to see what's listed?
Thanks for that link, that file plays back correctly. Oddly enough, I hadn't looked at the mediainfo. Doing so now, the files I created show this for the video: SMPTE ST 2094 App 4, Version 1, HDR10+ Profile B compatible

None of them show Dolby Vision in mediainfo, not even the HEVC file output by yusesope's tool... I guess something is going wrong there then?
Yeah that seems likely to be the issue. The only file I've tried is listed as Dolby Vision, Version 1.0, dvhe.08.06, BL+EL+RPU / SMPTE ST 2086, HDR10 compatible, same as the one in the post I linked. Are you also using the same tsmuxer version linked in that post?
Arbigator
Posts: 32
Joined: Fri Feb 28, 2020 9:16 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by Arbigator »

shawnc22 wrote: Tue Mar 10, 2020 7:24 pm
Arbigator wrote: Tue Mar 10, 2020 7:20 pm
shawnc22 wrote: Tue Mar 10, 2020 6:49 pm
The sample posted here: viewtopic.php?f=12&t=18602&start=1485#p85786 activates DV and Atmos on the Shield. Have you tried opening your files in mediainfo to see what's listed?
Thanks for that link, that file plays back correctly. Oddly enough, I hadn't looked at the mediainfo. Doing so now, the files I created show this for the video: SMPTE ST 2094 App 4, Version 1, HDR10+ Profile B compatible

None of them show Dolby Vision in mediainfo, not even the HEVC file output by yusesope's tool... I guess something is going wrong there then?
Yeah that seems likely to be the issue. The only file I've tried is listed as Dolby Vision, Version 1.0, dvhe.08.06, BL+EL+RPU / SMPTE ST 2086, HDR10 compatible, same as the one in the post I linked. Are you also using the same tsmuxer version linked in that post?
Yes, I am using that version. I've tried others as well. Hmm... This is weird that it's working for everyone else.
shawnc22
Posts: 637
Joined: Tue Jan 21, 2020 7:40 am

Re: Dolby Vision now possible through MP4 Mux.

Post by shawnc22 »

what movies have you tried? I can maybe give it a try later tonight if I have it in my library
Post Reply