Dolby Vision now possible through MP4 Mux.

Please post here for issues related to UHD discs
sw5163
Posts: 146
Joined: Sat Jun 25, 2022 7:28 am

Re: Dolby Vision now possible through MP4 Mux.

Post by sw5163 »

xxyz1 wrote:
Mon Sep 05, 2022 1:29 pm
But it says
integer number for Dolby vision BL signal cross-compatibility ID
For P8.1 you have to specify dolby vision base layer signal compatibility id to 1.(to 4 if DV hlg P8.4)

Code: Select all

mp4mux(bento4) --track dv.hevc#dv_profile=8,dv_bc=1,frame_rate=23.976 --track atmos.ec3 p81.hvc1.mp4
But, please don't use mp4mux(bento4) other than making iOS compatible mp4.
In fact, I have never been using it since mp4box v2.0 came out.
Use mp4muxer or mp4box or @RESET_9999 's script under his signature instead.

I see the file you have is already P8.1 dvhe, may I ask why would you like to convert it again?
xxyz1
Posts: 7
Joined: Mon Sep 05, 2022 1:21 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by xxyz1 »

sw5163 wrote: I see the file you have is already P8.1 dvhe, may I ask why would you like to convert it again?
Because my OLED LG 55B6D can't play thie Dolbyvision.
sw5163 wrote: Use mp4muxer or mp4box or @RESET_9999 's script under his signature instead.
Tried mp4muxer but can't open a mkv file. Is there a Howto?
The other I will try out.
staknhalo
Posts: 161
Joined: Sun Oct 11, 2020 12:05 am

Re: Dolby Vision now possible through MP4 Mux.

Post by staknhalo »

sw5163 wrote:
Mon Sep 05, 2022 2:14 am
staknhalo wrote:
Sun Sep 04, 2022 11:40 pm
Yeah, the mzabi release, even reacquired the 4-6-8 eps to confirm the missing/bad/garbage data was in source
I reacquired one of the eps you mentioned. Can confirm there is something wrong with the mp4 package.
It seems mp4box recognize it as h.263, no idea what that is.
However, you can split it:

Code: Select all

ffmpeg -i broken.mp4 -c copy -t 1:00 first.hevc
ffmpeg -i broken.mp4 -c copy -ss 1:00 second.hevc
And then concat them together (lossless)

Code: Select all

mp4box -cat first.hevc -cat second.hevc -new fix.dvh1.mp4
It will work on iOS devices.
No idea what's going on with that file.

Also why using aac instead of EAC3/atmos inside the file?
This worked for Ep4, thanks

But Ep6 and Ep8 get audio sync issues even with this (not Ep4 strangely) - using either my aac encoded audio or original sources' eac3 audio (I only do soundbars and space adds up over files/time - why I encode to aac stereo - with Dolby upmix though so it's something better than nothing if ever played on surround)

And even going from source ffmpeg throws this on 6 & 8

Code: Select all

Error applying bitstream filters to an output packet for stream #0: Invalid data found when processing input
av_interleaved_write_frame(): Invalid data found when processing input
Error muxing a packet for output file #0
Also, I notice DVHE profile 8 stutters on iOS/iPhone 8 Plus - only way to get it not to is to process with mp4box, but then in mediainfo it's labeled fake p5 - which I don't want for p8 files

I understand p8 alone and especially p8 with DVHE won't do DV on iOS, that's fine playback in HDR10 is what I'm fine with - but is the stutter always going to be there unless I make it a fake p5? Or is just because the iPhone 8 Plus is older, and on newer devices it will play smoother?

It's like even though DVHE it sees it's Dolby Vision and is just stuttering on the metadata on playback even if not displaying the RPU
sw5163
Posts: 146
Joined: Sat Jun 25, 2022 7:28 am

Re: Dolby Vision now possible through MP4 Mux.

Post by sw5163 »

staknhalo wrote:
Mon Sep 05, 2022 4:10 pm
But Ep6 and Ep8 get audio sync issues even with this (not Ep4 strangely) - using either my aac encoded audio or original sources' ec3 audio (I only do soundbars and space adds up over files/time - why I encode to aac with Dolby upmix though)
This release is just broken, I will give EP6 and 8 some tests.
staknhalo wrote:
Mon Sep 05, 2022 4:10 pm
I understand p8 alone and especially p8 with DVHE won't do DV on iOS, that's fine playback in HDR10 is what I'm fine with - but is the stutter always going to be there unless I make it a fake p5? Or is just because the iPhone 8 Plus is older, and on newer devices it will play smoother?
First, mp4 with dvhe flag is not even playable by Apple's native player, you can only play that with third-party APP like Infuse/plex.
Second, fake p5 is fine, Apple use it in their own ATV screensavers. The dolby windows app can play it, LG TV can play it.
https://sylvan.apple.com/Aerials/2x/entries.json

If you really don't want that, you can either: remove DV header (which won't do DV on anything)

Code: Select all

ffmpeg -i p8.dvhe.mp4 -c copy -vtag hvc1 hvc1.mp4
or convert to p8.1 hvc1 with DV(which won't do DV on Apple)

Code: Select all

mp4box -add dv.hevc:dv-profile=8.1 -new p81.hvc1.mp4
staknhalo wrote:
Mon Sep 05, 2022 4:10 pm
It's like even though DVHE it sees it's Dolby Vision and is just stuttering on the metadata on playback even if not displaying the RPU
It's very likely that whatever the player you are using to decode DVHE is processing the video on its own, instead of hand them properly to Apple's player core. That's why I never use third part player on iOS.
Last edited by sw5163 on Mon Sep 05, 2022 4:46 pm, edited 2 times in total.
staknhalo
Posts: 161
Joined: Sun Oct 11, 2020 12:05 am

Re: Dolby Vision now possible through MP4 Mux.

Post by staknhalo »

sw5163 wrote:
Mon Sep 05, 2022 4:34 pm
or convert to p8.1 hvc1 with DV(which won't do DV on Apple)

Code: Select all

mp4box -add dv.hevc:dv-profile=8.1 -new p81.hvc1.mp4
That's what I'm after for p8 - so like DVHE/DVH1, it's a HEV1/HVC1 issue - but only with Dolby Vision files - but yet HEV1 files not Dolby Vision play fine - only HEV1 with Dolby Vision - any clue as to why besides just the way it is (according to Apple)? Edit: No, HEV1 even without Dolby Vision stutters. I have a lot of work to do :?

Edit: Found this :
'hvc1' stores all parameter sets inside the MP4 container below the sample description boxes. 'hev1' stores all parameter sets in band (inside the HEVC stream).

The parameter sets are essentially mandatory metadata necessary to decode the streams.

So you have two slightly different ways of muxing HEVC into MP4.

I'd choose based on the play out and transport scenario.

Your player or your transport specification may require one or the other.
sw5163 wrote:
Mon Sep 05, 2022 4:34 pm
It's very likely that whatever the player you are using to decode DVHE is processing the video on its own, instead of hand them properly to Apple's player core. That's why I never use third part player on iOS.
Plex for Android/iOS - Windows is just native Windows Store apps with Dolby Vision plugin simply to verify RPU alignment/sound and audio in sync/etc
sw5163
Posts: 146
Joined: Sat Jun 25, 2022 7:28 am

Re: Dolby Vision now possible through MP4 Mux.

Post by sw5163 »

staknhalo wrote:
Mon Sep 05, 2022 4:41 pm
Edit: Found this :
Yes, that's the reason mp4muxer/mp4dovi from github resulting in black screen.
Change fourcc codec in hex is not enough.
staknhalo wrote:
Mon Sep 05, 2022 4:41 pm
That's what I'm after for p8 - so like DVHE/DVH1, it's a HEV1/HVC1 issue - but only with Dolby Vision files - but yet HEV1 files not Dolby Vision play fine - only HEV1 with Dolby Vision - any clue as to why besides just the way it is (according to Apple)? Edit: No, HEV1 even without Dolby Vision stutters. I have a lot of work to do :?
You can regard players that play hev1/dvhe are first doing "software decoding", then pass them to Apple's player core.
While hvc1/dvh1 pass directly to Apple's player core and do "hardware decoding".
staknhalo wrote:
Mon Sep 05, 2022 4:10 pm
Or is just because the iPhone 8 Plus is older, and on newer devices it will play smoother
No, iPhone 8 Plus use A11 bionic and my iPad Pro 2017 use A10x fusion, they are way sufficient enough to play DV.
In fact, I think if Dolby allow Apple to play FEL, they can play even 4K 60 fps FEL and 4K 120fps MEL. (8K should have a problem though)
Last edited by sw5163 on Mon Sep 05, 2022 5:25 pm, edited 2 times in total.
staknhalo
Posts: 161
Joined: Sun Oct 11, 2020 12:05 am

Re: Dolby Vision now possible through MP4 Mux.

Post by staknhalo »

sw5163 wrote:
Mon Sep 05, 2022 4:34 pm

Code: Select all

mp4box -add dv.hevc:dv-profile=8.1 -new p81.hvc1.mp4
Off the top of your head, do you know what the command would be for profile 7 single layer FEL, if supported? Just:

Code: Select all

mp4box -add dv.hevc:dv-profile=7 -new p7.hvc1.mp4
Edit: Yes that was it

Double edit: No, spits out an p7 mp4, but still hev1

Triple edit: No, I'm a dummy, demux first, don't just go mp4>mp4, it spits out HVC1 though - could I now just hex edit that to DVH1? Let's see.........
sw5163
Posts: 146
Joined: Sat Jun 25, 2022 7:28 am

Re: Dolby Vision now possible through MP4 Mux.

Post by sw5163 »

staknhalo wrote:
Mon Sep 05, 2022 5:05 pm
Off the top of your head
No idea what that means.
staknhalo wrote:
Mon Sep 05, 2022 5:05 pm
do you know what the command would be for profile 7 single layer FEL, if supported? Just:
Apple doesn't support FEL, only MEL.
I have done all the possible conversions I could think of.
staknhalo
Posts: 161
Joined: Sun Oct 11, 2020 12:05 am

Re: Dolby Vision now possible through MP4 Mux.

Post by staknhalo »

staknhalo wrote:
Mon Sep 05, 2022 5:05 pm
sw5163 wrote:
Mon Sep 05, 2022 4:34 pm

Code: Select all

mp4box -add dv.hevc:dv-profile=8.1 -new p81.hvc1.mp4
Off the top of your head, do you know what the command would be for profile 7 single layer FEL, if supported? Just:

Code: Select all

mp4box -add dv.hevc:dv-profile=7 -new p7.hvc1.mp4
Edit: Yes that was it

Double edit: No, spits out an p7 mp4, but still hev1

Triple edit: No, I'm a dummy, demux first, don't just go mp4>mp4, it spits out HVC1 though - could I now just hex edit that to DVH1? Let's see.........
This is working with single layer FEL p7

Playback is smooth on iOS/iPhone 8 Plus as just HDR10, triggers Dolby Vision on Android TV - both RPU on just SHIELD (doesn't support FEL) - and FEL and RPU on Tivo Stream 4k

Used Game of Thrones UHD FEL and Reset's Clockwork Orange FEL test file to confirm

Just hex edit fist HVC1 to DVH1 in hex editor after p7.mp4 output from mp4box (probably not needed, as I believe Android just reads from the HEV stream - but this way will show 'dvh1' codec ID in mediainfo)

Image

https://mega.nz/file/kGJwiBaL#XUH0tvI1J ... 9gHNfYZHKo
Last edited by staknhalo on Mon Sep 05, 2022 6:21 pm, edited 1 time in total.
sw5163
Posts: 146
Joined: Sat Jun 25, 2022 7:28 am

Re: Dolby Vision now possible through MP4 Mux.

Post by sw5163 »

staknhalo wrote:
Mon Sep 05, 2022 6:10 pm
Just hex edit fist HVC1 to DVH1 in hex editor after p7.mp4 output from mp4box
You can just use

Code: Select all

mp4box -add BL_RPU.hevc:dv-profile=f7 -new p7.dvh1.mp4
And yes it will play MEL, but please don't do this.
sw5163 wrote:
Mon Jul 18, 2022 6:11 pm
RESET_9999 wrote:
Mon Jul 18, 2022 3:15 pm
@ragico just tested and it's working in MP4 P8 DVH1 + LPCM audio.
Like I posted last month
sw5163 wrote:
Sun Jun 26, 2022 6:04 pm
mp4box with following command can also get dolby vision to work:
mp4box -add BL_RPU.hevc -new p5.dvh1.mp4
mp4box -add BL_RPU.hevc:dv-profile=8.1 -new p8.hvc1.mp4(this doesn't work, it's a SMB bug)
mp4box -add BL_RPU.hevc:dv-profile=f8.1 -new p8.dvh1.mp4
But fake p5.dvh1 is the most stable way, it guarantee DV play.
Besides there are official release use fake p5.dvh1(those Apple TV screensaver).
And I've never seen p8 with dvh1 except from my experiment result.
So I think it's better for us to just stick to fake p5.dvh1 for now.
Also p8.dvh1 seems to let Apple think it's an HLG, video significantly darker than normal on my iPad.
p7.dvh1 play properly. Let's not make this even more complicated.
p7.dvh1 is never used by any release.
And if you are playing a true FEL on ATV and it shows DV, it's fake, RPU is not used.

There is "reshaping" data inside FEL RPU that needs to be removed to play MEL on ATV.
I don't know how to explain this easily, you will need to read around Page P455 and P460 to figure it out.
Last edited by sw5163 on Mon Sep 05, 2022 6:24 pm, edited 1 time in total.
staknhalo
Posts: 161
Joined: Sun Oct 11, 2020 12:05 am

Re: Dolby Vision now possible through MP4 Mux.

Post by staknhalo »

It's for my own file consistency, while maintaining broad playback compatibility, it's better for me and my own collection this way

Code: Select all

mp4box -add BL_RPU.hevc:dv-profile=f7 -new p7.dvh1.mp4
ok that's what I was missing, thanks

Here's Reset's Clockwork Orange FEL test made with that for anyone who wants it (tested separately and confirmed again just to make sure on iPhone 8 Plus/SHIELD/Tivo Stream 4K)

https://mega.nz/file/8bAAERgS#RV3DLJf7F ... 0P6QGMFWCc

I don't care about getting Dolby Vision from FEL files to play in Dolby Vision on iOS - I'm fine with FEL as HDR10 playback only on iOS - but unless you do all this (to make HVC1/DVH1) just HDR10 playback on iOS will be choppy still - that's what this was all about for me

So now on Android - P5 and P8 and P7 will play as so - Windows P5 and P8 will play as so, while P7 will be HDR10 only - and on iOS P5 will play as so, while P8 and P7 will play as HDR10 only (but without choppiness) - this is what this achieved for me and what I wanted

Before, when things were DVHE/HEV1, on Android and Windows things were like above, but EVERYTHING was choppy on iOS no matter what
Last edited by staknhalo on Mon Sep 05, 2022 6:41 pm, edited 1 time in total.
sw5163
Posts: 146
Joined: Sat Jun 25, 2022 7:28 am

Re: Dolby Vision now possible through MP4 Mux.

Post by sw5163 »

staknhalo wrote:
Mon Sep 05, 2022 6:23 pm
It's for my own file consistency, while maintaining broad playback compatibility, it's better for me and my own collection this way
If that's the case, still don't use p7.dvh1, use p7.hvc1 instead.

For FEL file:
FEL capable blu-ray player -- both p7.hvc1 and p7.dvh1 will work (most likely)

Apple devices with plex -- p7.hvc1 fall back to HDR10 properly / p7.dvh1 trigger fake DV
or even worse: wrong colour due to additional "reshaping" data in FEL.
(This is minor and hard to see at first, but noticeable when scene change/dark scene)

Apple devices with native player -- p7.hvc1 fall back to HDR10 properly / p7.dvh1 lead to system crash.

Non DV device -- p7.hvc1 fall back to HDR10 properly / p7.dvh1 probably won't be recognized.

For MEL/p8.1 file:
FEL capable blu-ray player -- all files should be fine.
Apple devices -- p7/p81.hvc1 fall back to HDR10 / p7.dvh1 trigger dv / p5.dvh1 trigger dv

Confirmed your sample p7.test.first won't play on Apple's native player, plex may be able to play it, but don't let it get into DV mode
1.PNG
2.PNG
3.PNG
Last edited by sw5163 on Mon Sep 05, 2022 7:09 pm, edited 1 time in total.
RESET_9999
Posts: 2105
Joined: Mon Aug 05, 2019 7:12 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by RESET_9999 »

staknhalo wrote:
Mon Sep 05, 2022 6:23 pm
Here's Reset's Clockwork Orange FEL test made with that for anyone who wants it (tested separately and confirmed again just to make sure on iPhone 8 Plus/SHIELD/Tivo Stream 4K)
https://mega.nz/file/8bAAERgS#RV3DLJf7F ... 0P6QGMFWCc
I now prefer to verify FEL with the original Power Rangers sample instead of that file with random EL.

ST-DL: https://drive.google.com/file/d/1XaQTE0 ... sp=sharing
DT-DL: https://drive.google.com/file/d/1Fjg5i7 ... sp=sharing

bright white text = FEL
grey darker text = No FEL
staknhalo
Posts: 161
Joined: Sun Oct 11, 2020 12:05 am

Re: Dolby Vision now possible through MP4 Mux.

Post by staknhalo »

sw5163 wrote:
Mon Sep 05, 2022 6:40 pm
If that's the case, still don't use p7.dvh1, use p7.hvc1 instead.
So then a file like this

https://mega.nz/file/8D5xXAwI#BLWOWqujN ... k8aytMBliE

which I made using

Code: Select all

mp4box -add video.hevc:dv-profile=7 -new P7hvc1-yesDVcommand.mp4
iTunes still lets me add that to the iPhone and play it via Apple TV app - still plays fine as it should everywhere else (Windows/Plex/Android - and displays RPU on SHIELD and full FEL on Chromecast)

---------------------------------------------------------------------------------------------------------------------------------------

However if I make a file like this

https://mega.nz/file/pSI2hJTA#HWtLKnzNc ... ITONC1wTjY

made using this command you gave me

Code: Select all

mp4box -add video.hevc:dv-profile=f7 -new p7dvh1-yesDVcommand.mp4
Everything still plays as it should, the file will also have the DVH1 tag just for file consistency, and iTunes WILL NOT add it at all, so can't transfer to iPhone this way - so in theory you can't accidentally play it via Apple native video player

---------------------------------------------------------------------------------------------------------------------------------------

Just to test, I made this version

https://mega.nz/file/FfJSkZwB#IOXQ_baMR ... q-j_kNb5R4

using this command

Code: Select all

mp4box -add video.hevc -new P7hvc1-noDVcommand.mp4
And it DOES NOT play properly on Android/SHIELD/Tivo - HDR10 only everywhere - so it is not the inner HEVC stream they look at only/ever when playing like I thought - when using HVC1 they respect the rules and look to the container - see nothing - and so no DV playback

When using mp4muxer it is output as DVHE/HEV1 - so then they know to look to the inner HEVC stream (which is why mkv works too this way I suppose)
RESET_9999 wrote:
Mon Sep 05, 2022 7:04 pm
I now prefer to verify FEL with the original Power Rangers sample instead of that file with random EL.
I like the Clockwork Orange one, if what you want to see is there (flashing colors for RPU and/or Paramount/Dreamworks intro for FEL video data), it's like a punch in the face, you can't miss it :lol:
RESET_9999
Posts: 2105
Joined: Mon Aug 05, 2019 7:12 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by RESET_9999 »

staknhalo wrote:
Mon Sep 05, 2022 8:28 pm
I like the Clockwork Orange one, if what you want to see is there (flashing colors for RPU and/or Paramount/Dreamworks intro for FEL video data), it's like a punch in the face, you can't miss it :lol:
right but those flashes are just a buggy reaction, not the actual RPU working.
I prefer quietvoid's rpu test file + power rangers sample for fel

Because when you play the clockwork file on a player that is not supposed to have an L1/L2 RPU reaction like MPV, there's still a rpu reaction because the file is actually buggy and not because the rpu is working.
If you play quietvoid's rpu test file on MPV, there is no reaction at all which is the correct behavior.
Post Reply