Dolby Vision now possible through MP4 Mux.

Please post here for issues related to UHD discs
kws53
Posts: 49
Joined: Sun May 04, 2014 9:09 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by kws53 »

shawnc22 wrote:
Wed Sep 16, 2020 10:06 pm
They're not really fixing anything. The 04.06 version is an old version (circa ~March/April) that assigned BL+EL+RPU streams as profile 4. The current version nightly assigns them as profile 6. The 05.06 version is I think a user modified version that forcibly assigns a BL+RPU stream as profile 5 instead of 8 for playback on AppleTVs. I don't know what the 08.06 version is, but if it's forcibly assigning streams as profile 8, then I wouldn't go near it. The current nightly correctly labels BL+RPU streams as profile 8 and that's about the only thing that should be labeled as profile 8.
What would you recommend using for BL+EL+RPU.hevc made from Yusesope's tool with a Shield Pro 2019? I'm currently using 0406fix but currently have no way of verifying its efficacy as my 77CX is enroute. Are you suggesting using the 06.06fix (or as an alternative, the current nightly) for my purposes?
pitrako
Posts: 17
Joined: Sun Sep 13, 2020 7:55 am

Re: Dolby Vision now possible through MP4 Mux.

Post by pitrako »

yusesope wrote:
Thu Sep 17, 2020 2:59 pm
Good afternoon everyone.
The weekend is approaching so it seemed appropriate to me to release something for you to play with.

I start by thanking @jcdr428 (from TsMuxeR a.k.a a5180007) who gave me the possibility to use and modify his code for parsing the NALU RPUs.

As anticipated some posts ago, maybe I found the way to "convert" a FEL file to MEL.
This latest innovation together with the previous idea of ​​combining the two layers (BL and EL_RPU) in a single track, should guarantee the possibility of playing any FEL UHD-BD backup on Android devices equipped with a Dolby Vision decoder and capable of playing THIS file (+ my ExoPlayer) or THIS file.

Fingers crossed!

Forgive immediately any error in the code but this time I'm just out of my comfort zone: the pure python implementation of the new idea would have resulted in an extension of the times from 20 minutes (with the CPU always at 100%) up to 60-80 minutes. I had to rewrite the new idea in C++, cutting the time down to less than 60 seconds. Theoretically therefore, you shouldn't notice any difference in timing compared to previous versions of my tool.
I don't have a mac and I can't (want :roll: ) compile my code for macOS users. For now the latter cannot use this version of my tool (the problem is easily solved if some of you with a mac compile my code).


HERE is the new version (I don't update my original post because I wait for your tests first) and these are the steps I followed to make the test videos that some of you tried a few days ago (once again HERE).
You need FFmpeg (the executable is in the bin folder) and this version of mp4muxer. Before testing an entire film I advise you to work with 120 second cuts.

It goes without saying that these tests must be done on FEL titles. Do not use titles that are already MEL !!!!!


In the case of a Dual Track Dual Layer DV file (e.g. an m2ts file in the BDMV\STREAM folder)
  • Extract the base layer and the enhancement layer

    Code: Select all

    ffmpeg -i path\to\the\file.m2ts -ss 0 -t 120 -map 0:0 -c copy path\to\BL.hevc
    ffmpeg -i path\to\the\file.m2ts -ss 0 -t 120 -map 0:1 -c copy path\to\EL.hevc
  • Using my tool, double click on the MUX_AND_CONVERT_TO_MEL.bat file and follow the instructions on the screen.
    You will get a BL_EL_RPU.hevc file
  • Create an mp4 file

    Code: Select all

    mp4muxer -i path\to\BL_EL_RPU.hevc --dv-profile 7 -o path\to\TEST_FILE.mp4

In the case of a Single Track Dual Layer DV file (e.g. mkv, ts, mp4 file previously modified using MakeMKV and/or TsMuxeR and/or my tool)
  • Extract the BL_EL_RPU.hevc file

    Code: Select all

    ffmpeg -i path\to\the\file.mp4 -ss 0 -t 120 -map 0:0 -c copy path\to\BL_EL_RPU.hevc
  • Using my tool, double click on the DEMUX_AND_CONVERT_TO_MEL.bat file and follow the instructions on the screen.
    You will get a BL.hevc file and a EL_RPU.hevc file
  • Using my tool, double click on the MUX.bat file (and NOT MUX_AND_CONVERT_TO_MEL.bat) and follow the instructions on the screen.
    You will get a BL_EL_RPU.hevc file
  • Create an mp4 file

    Code: Select all

    mp4muxer -i path\to\BL_EL_RPU.hevc --dv-profile 7 -o path\to\TEST_FILE.mp4


To avoid problems, if you can, use my version of ExoPlayer (HERE).

I purposely didn't use TsMuxeR because the final output wouldn't have profile 7.
If my gimmick works maybe @jcdr428 can modify TsMuxeR once again to make files with profile 7 thus eliminating all those versions (04.fix, 06.fix, 08.fix) that are circulating and that only confuse ideas.

Happy testing!
Exception in thread Thread-5:SIS: 0.0% BL_EL_RPU WRITING: 0.0% (BL AUs: 244 EL AUs: 571)
Traceback (most recent call last):
File "D:\Dolby Vision\v0.0.4_BETA\python-3.7.6.amd64\lib\threading.py", line 926, in _bootstrap_inner
self.run()
File "src\app.py", line 395, in run
self.cpp_lib = self.init_cpp_lib()
File "src\app.py", line 342, in init_cpp_lib
cpp_lib = cdll.LoadLibrary(cpp_lib_path)
File "D:\Dolby Vision\v0.0.4_BETA\python-3.7.6.amd64\lib\ctypes\__init__.py", line 442, in LoadLibrary
return self._dlltype(name)
File "D:\Dolby Vision\v0.0.4_BETA\python-3.7.6.amd64\lib\ctypes\__init__.py", line 364, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] Cannot find the specified module

BL_ANALYSIS: 0.0% EL_ANALYSIS: 0.0% BL_EL_RPU WRITING: 0.0% (BL AUs: 509 EL AUs: 571)

Error for me and stuck.
Last edited by pitrako on Thu Sep 17, 2020 4:27 pm, edited 2 times in total.
quietvoid
Posts: 377
Joined: Sun Apr 19, 2020 4:15 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by quietvoid »

yusesope wrote:
Thu Sep 17, 2020 2:59 pm
It goes without saying that these tests must be done on FEL titles. Do not use titles that are already MEL !!!!!
Just tried this and it works on the FireTV Stick 4K.

On archlinux, my steps (starting from a mode1 muxed BL_EL_RPU.hevc file):
Mux to mkv, split to make smaller.
Demux to hevc.
python app.py -lbf 50 -demux -fel_to_mel -if video.hevc
python app.py -lbf 50 -mux -bl BL.hevc -el EL_RPU.hevc
mp4muxer_64bits -i BL_EL_RPU.hevc --dv-profile 7 -o test.mp4

And it plays in Dolby Vision with ExoPlayer. :)
PS: there should probably be an indication or something to stop instead of just "Wait...", the default -lbf value just hanged because the file sample is small.
jcdr428
Posts: 34
Joined: Fri Mar 20, 2020 6:55 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by jcdr428 »

yusesope wrote:
Thu Sep 17, 2020 2:59 pm
I purposely didn't use TsMuxeR because the final output wouldn't have profile 7.
If my gimmick works maybe @jcdr428 can modify TsMuxeR once again to make files with profile 7 thus eliminating all those versions (04.fix, 06.fix, 08.fix) that are circulating and that only confuse ideas.
Hi @yusesope, so you need tsMuxer to register profile 6 as profile 4 to be read by ExoPlayer, is this correct ?
I am still reluctant to push this hack to tsMuxer as profile 4 BL should be SDR, not HDR10. Then AppleTV users will still need to use 05.06 fix to register profile 8 as profile 5.
Why not push a commit to ExoPlayer to read profile 6 (DvheDth) ?
pitrako
Posts: 17
Joined: Sun Sep 13, 2020 7:55 am

Re: Dolby Vision now possible through MP4 Mux.

Post by pitrako »

I need some .dll or something? MUX.bat works but MUX_AND_CONVERT_TO_MEL.bat doesn't work, It shows the error I posted above.
PapitaHD
Posts: 26
Joined: Sun Mar 01, 2020 10:31 am

Re: Dolby Vision now possible through MP4 Mux.

Post by PapitaHD »

Exception in thread Thread-5:SIS: 0.0% BL_EL_RPU WRITING: 0.0% (BL AUs: 244 EL AUs: 571)
Traceback (most recent call last):
File "D:\Dolby Vision\v0.0.4_BETA\python-3.7.6.amd64\lib\threading.py", line 926, in _bootstrap_inner
self.run()
File "src\app.py", line 395, in run
self.cpp_lib = self.init_cpp_lib()
File "src\app.py", line 342, in init_cpp_lib
cpp_lib = cdll.LoadLibrary(cpp_lib_path)
File "D:\Dolby Vision\v0.0.4_BETA\python-3.7.6.amd64\lib\ctypes\__init__.py", line 442, in LoadLibrary
return self._dlltype(name)
File "D:\Dolby Vision\v0.0.4_BETA\python-3.7.6.amd64\lib\ctypes\__init__.py", line 364, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] Cannot find the specified module

BL_ANALYSIS: 0.0% EL_ANALYSIS: 0.0% BL_EL_RPU WRITING: 0.0% (BL AUs: 509 EL AUs: 571)

Error for me and stuck.
Same error for me. I'm trying to convert/remux Gemini Man from a full UHD BluRay backup. Officially it's a FEL title, although it has about the lowest bitrare a FEL can have.
Later I'll try Saving Private Ryan.
shawnc22
Posts: 637
Joined: Tue Jan 21, 2020 7:40 am

Re: Dolby Vision now possible through MP4 Mux.

Post by shawnc22 »

kws53 wrote:
Thu Sep 17, 2020 3:48 pm
shawnc22 wrote:
Wed Sep 16, 2020 10:06 pm
They're not really fixing anything. The 04.06 version is an old version (circa ~March/April) that assigned BL+EL+RPU streams as profile 4. The current version nightly assigns them as profile 6. The 05.06 version is I think a user modified version that forcibly assigns a BL+RPU stream as profile 5 instead of 8 for playback on AppleTVs. I don't know what the 08.06 version is, but if it's forcibly assigning streams as profile 8, then I wouldn't go near it. The current nightly correctly labels BL+RPU streams as profile 8 and that's about the only thing that should be labeled as profile 8.
What would you recommend using for BL+EL+RPU.hevc made from Yusesope's tool with a Shield Pro 2019? I'm currently using 0406fix but currently have no way of verifying its efficacy as my 77CX is enroute. Are you suggesting using the 06.06fix (or as an alternative, the current nightly) for my purposes?
You're good, but either should work without issue, though.
jcdr428 wrote:
Thu Sep 17, 2020 5:12 pm
yusesope wrote:
Thu Sep 17, 2020 2:59 pm
I purposely didn't use TsMuxeR because the final output wouldn't have profile 7.
If my gimmick works maybe @jcdr428 can modify TsMuxeR once again to make files with profile 7 thus eliminating all those versions (04.fix, 06.fix, 08.fix) that are circulating and that only confuse ideas.
Hi @yusesope, so you need tsMuxer to register profile 6 as profile 4 to be read by ExoPlayer, is this correct ?
I am still reluctant to push this hack to tsMuxer as profile 4 BL should be SDR, not HDR10. Then AppleTV users will still need to use 05.06 fix to register profile 8 as profile 5.
Why not push a commit to ExoPlayer to read profile 6 (DvheDth) ?
Please correct me if I'm wrong, but I think yusecope is suggesting that what tsmuxer is currently registering as profile 6 should go back to being registered as profile 7. It's currently what MakeMKV is doing with the same BL+EL+EPU tracks and it seems to have had no ill effects on playback capabilities (on the Shield w/Exoplayer at least). Mike has mentioned in that past the dual track vs single track transport methods of BL,EL+RPU should have no bearing on profile choice, so I think with the deprecation of profile 6, 7 should technically be the correct assignment for these files.
yusesope
Posts: 221
Joined: Sun Jul 28, 2019 3:34 am

Re: Dolby Vision now possible through MP4 Mux.

Post by yusesope »

quietvoid wrote:
Thu Sep 17, 2020 4:19 pm
Just tried this and it works on the FireTV Stick 4K...On archlinux...And it plays in Dolby Vision with ExoPlayer. :)
It always warms the heart to see "archlinux" written somewhere :D . Thanks for your feedback.
pitrako wrote:
Thu Sep 17, 2020 5:17 pm
I need some .dll or something? MUX.bat works but MUX_AND_CONVERT_TO_MEL.bat doesn't work, It shows the error I posted above.
PapitaHD wrote:
Thu Sep 17, 2020 5:31 pm
Same error for me. I'm trying to convert/remux Gemini Man from a full UHD BluRay backup. Officially it's a FEL title, although it has about the lowest bitrare a FEL can have.
Later I'll try Saving Private Ryan.
Yes you are right. Your Windows needs THESE libraries (unpack the archive and place the two dll files where there are the files MUX.bat, DEMUX.bat, etc ...). It's not an elegant solution but it should at least work for these days of testing.
Let me know!
jcdr428 wrote:
Thu Sep 17, 2020 5:12 pm
Hi @yusesope, so you need tsMuxer to register profile 6 as profile 4 to be read by ExoPlayer, is this correct?
The files that are created by this latest version have as VUI:
0,9,16,9,2 for the Base layer
0,9,16,9,2 for the Enhancement layer.
The correct profile should therefore be 7.
Now I don't remember well but it seems to me that TsMuxeR currently generates files with profile 6 (but, I repeat myself, I could be wrong). If my tool proves to work, in my opinion, we should try to mark the ts files with profile 7 (and not 6).
shawnc22 wrote:
Thu Sep 17, 2020 5:39 pm
I think yusecope is suggesting that what tsmuxer is currently registering as profile 6 should go back to being registered as profile 7
Yep, Exactly!
hepe9
Posts: 71
Joined: Mon Jun 03, 2019 11:04 am

Re: Dolby Vision now possible through MP4 Mux.

Post by hepe9 »

quietvoid wrote:
Thu Sep 17, 2020 4:19 pm
yusesope wrote:
Thu Sep 17, 2020 2:59 pm
It goes without saying that these tests must be done on FEL titles. Do not use titles that are already MEL !!!!!
Just tried this and it works on the FireTV Stick 4K.

On archlinux, my steps (starting from a mode1 muxed BL_EL_RPU.hevc file):
Mux to mkv, split to make smaller.
Demux to hevc.
python app.py -lbf 50 -demux -fel_to_mel -if video.hevc
python app.py -lbf 50 -mux -bl BL.hevc -el EL_RPU.hevc
mp4muxer_64bits -i BL_EL_RPU.hevc --dv-profile 7 -o test.mp4

And it plays in Dolby Vision with ExoPlayer. :)
PS: there should probably be an indication or something to stop instead of just "Wait...", the default -lbf value just hanged because the file sample is small.
A Firestick playing DV profile 7?

In this thread I read to many people saying the Firestick can't play DV profile 7

I'm confused right now

Edit:
yusesope wrote:
Tue Mar 31, 2020 1:45 pm
Finally, I join people who ask for the possibility to choose the most congenial DV profile: the dvhe.05 files obtained with my tool (or with DVDFab) are not standard at all (we are well aware of that) but there are devices (Apple TV, Fire Stick 4K) which can only play this type of file!
yusesope wrote:
Wed Mar 18, 2020 10:58 am
Do you guys want to check the correct functioning of my tool?
Well, create an mp4 file with Dolby's mp4muxer (bearing in mind the limitations of the individual device, like MEL vs FEL or hardware capability):
"-mode 1" (default mode) in my tool and "--dv-profile 4" in mp4muxer for owners of the new Shield (2019)
"-mode 1" (default mode) in my tool and "--dv-profile 7" (maybe also --dv-profile 4) in mp4muxer for owners of LG OLED TV (ninth, eighth
..series...maybe seventh series)
"-mode 2" in my tool and "--dv-profile 5" in mp4muxer for owners of Fire Stick 4K
This has changed?
shawnc22
Posts: 637
Joined: Tue Jan 21, 2020 7:40 am

Re: Dolby Vision now possible through MP4 Mux.

Post by shawnc22 »

hepe9 wrote:
Thu Sep 17, 2020 6:08 pm
quietvoid wrote:
Thu Sep 17, 2020 4:19 pm
yusesope wrote:
Thu Sep 17, 2020 2:59 pm
It goes without saying that these tests must be done on FEL titles. Do not use titles that are already MEL !!!!!
Just tried this and it works on the FireTV Stick 4K.

On archlinux, my steps (starting from a mode1 muxed BL_EL_RPU.hevc file):
Mux to mkv, split to make smaller.
Demux to hevc.
python app.py -lbf 50 -demux -fel_to_mel -if video.hevc
python app.py -lbf 50 -mux -bl BL.hevc -el EL_RPU.hevc
mp4muxer_64bits -i BL_EL_RPU.hevc --dv-profile 7 -o test.mp4

And it plays in Dolby Vision with ExoPlayer. :)
PS: there should probably be an indication or something to stop instead of just "Wait...", the default -lbf value just hanged because the file sample is small.
A Firestick playing DV profile 7?

In this thread I read to many people saying the Firestick can't play DV profile 7

I'm confused right now
A device's inability to previously play profile 7 files probably has more to do with the fact that the BL and EL+RPU layers were in separate tracks and not the actual profile label itself.
pitrako
Posts: 17
Joined: Sun Sep 13, 2020 7:55 am

Re: Dolby Vision now possible through MP4 Mux.

Post by pitrako »

yusesope wrote:
Thu Sep 17, 2020 5:54 pm
quietvoid wrote:
Thu Sep 17, 2020 4:19 pm
Just tried this and it works on the FireTV Stick 4K...On archlinux...And it plays in Dolby Vision with ExoPlayer. :)
It always warms the heart to see "archlinux" written somewhere :D . Thanks for your feedback.
pitrako wrote:
Thu Sep 17, 2020 5:17 pm
I need some .dll or something? MUX.bat works but MUX_AND_CONVERT_TO_MEL.bat doesn't work, It shows the error I posted above.
PapitaHD wrote:
Thu Sep 17, 2020 5:31 pm
Same error for me. I'm trying to convert/remux Gemini Man from a full UHD BluRay backup. Officially it's a FEL title, although it has about the lowest bitrare a FEL can have.
Later I'll try Saving Private Ryan.
Yes you are right. Your Windows needs THESE libraries (unpack the archive and place the two dll files where there are the files MUX.bat, DEMUX.bat, etc ...). It's not an elegant solution but it should at least work for these days of testing.
Let me know!
jcdr428 wrote:
Thu Sep 17, 2020 5:12 pm
Hi @yusesope, so you need tsMuxer to register profile 6 as profile 4 to be read by ExoPlayer, is this correct?
The files that are created by this latest version have as VUI:
0,9,16,9,2 for the Base layer
0,9,16,9,2 for the Enhancement layer.
The correct profile should therefore be 7.
Now I don't remember well but it seems to me that TsMuxeR currently generates files with profile 6 (but, I repeat myself, I could be wrong). If my tool proves to work, in my opinion, we should try to mark the ts files with profile 7 (and not 6).
shawnc22 wrote:
Thu Sep 17, 2020 5:39 pm
I think yusecope is suggesting that what tsmuxer is currently registering as profile 6 should go back to being registered as profile 7
Yep, Exactly!
I tried "A quiet place", It's a FEL title, in exoplayer through kodi and doesn't play, It stays at 00:00. And I think I followed all the steps (extract with FFmpeg, mux and convert to MEL and create a mp4 file with mp4muxer.
Last edited by pitrako on Thu Sep 17, 2020 6:37 pm, edited 1 time in total.
hepe9
Posts: 71
Joined: Mon Jun 03, 2019 11:04 am

Re: Dolby Vision now possible through MP4 Mux.

Post by hepe9 »

shawnc22 wrote:
Thu Sep 17, 2020 6:26 pm
hepe9 wrote:
Thu Sep 17, 2020 6:08 pm
quietvoid wrote:
Thu Sep 17, 2020 4:19 pm


Just tried this and it works on the FireTV Stick 4K.

On archlinux, my steps (starting from a mode1 muxed BL_EL_RPU.hevc file):
Mux to mkv, split to make smaller.
Demux to hevc.
python app.py -lbf 50 -demux -fel_to_mel -if video.hevc
python app.py -lbf 50 -mux -bl BL.hevc -el EL_RPU.hevc
mp4muxer_64bits -i BL_EL_RPU.hevc --dv-profile 7 -o test.mp4

And it plays in Dolby Vision with ExoPlayer. :)
PS: there should probably be an indication or something to stop instead of just "Wait...", the default -lbf value just hanged because the file sample is small.
A Firestick playing DV profile 7?

In this thread I read to many people saying the Firestick can't play DV profile 7

I'm confused right now
A device's inability to previously play profile 7 files probably has more to do with the fact that the BL and EL+RPU layers were in separate tracks and not the actual profile label itself.
Thanks for the answer :wink:
quietvoid
Posts: 377
Joined: Sun Apr 19, 2020 4:15 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by quietvoid »

hepe9 wrote:
Thu Sep 17, 2020 6:08 pm
A Firestick playing DV profile 7?
In this thread I read to many people saying the Firestick can't play DV profile 7
I'm confused right now
For what it's worth, I've mentioned already that I can play everything except FEL files on mine.
viewtopic.php?f=12&t=21937&p=93904#p93904
PlatypusW
Posts: 50
Joined: Mon Aug 03, 2020 2:14 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by PlatypusW »

yusesope wrote:
Thu Sep 17, 2020 2:59 pm

As anticipated some posts ago, maybe I found the way to "convert" a FEL file to MEL.
This latest innovation together with the previous idea of ​​combining the two layers (BL and EL_RPU) in a single track, should guarantee the possibility of playing any FEL UHD-BD backup on Android devices equipped with a Dolby Vision decoder and capable of playing THIS file (+ my ExoPlayer) or THIS file.

Fingers crossed!
I’ll try and test over the weekend :D

I presume that this isn’t something that could be done ‘on the fly’ at some point? We would need to change the makemkv MKVs to these MP4s each time? I.e. wouldn’t be able to just play the FEL mkv using exoplayer.
ragico
Posts: 265
Joined: Fri Feb 15, 2019 1:09 am

Re: Dolby Vision now possible through MP4 Mux.

Post by ragico »

Following Yusesope instructions, I did the full movie of Despicable me 3 (which is fel) from the original UHD disc backup. I also add an ac3 5.1 audio track to the mp4.
In the Firestick 4k the movie plays perfectly in dolby vision whilst the original fel gives only audio and black screen as all the fel movies in the firestick 4k.
I have used kodi 18.8 and yusesope exoplayer as recommended.
Perfect also the fast fwd/rear navigation.
In next days I will compare it with the original disc played on sony x700 feeding a Panasonic GZ2000 oled.
Yusesope you continue to amaze.
Thankkssssssssssss.
:) :) :)
Post Reply