Dolby Vision now possible through MP4 Mux.

Please post here for issues related to UHD discs
RESET_9999
Posts: 2090
Joined: Mon Aug 05, 2019 7:12 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by RESET_9999 »

hdr=none
we tested on appletv and LPCM audio didn't work when using it IIRC so that's why you see HDR10 two times when choosing fake p5
johnjon94
Posts: 35
Joined: Thu Nov 11, 2021 5:59 am

Re: Dolby Vision now possible through MP4 Mux.

Post by johnjon94 »

RESET_9999 wrote:
Wed Oct 05, 2022 2:00 am
johnjon94 wrote:
Wed Oct 05, 2022 1:49 am
The fake P5 doesn't seem to be working properly. It set a very odd FPS resulting in this crazy length
maybe an appleTV web-dl ? i know the old mp4muxer also had issue muxing those file because they dont have FPS bistream information.
with the sample files i used, there is no problem:


Code: Select all

Video
ID                                       : 1
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L5.1@High
HDR format                               : Dolby Vision, Version 1.0, dvhe.05.06, BL+RPU, HDR10 compatible / SMPTE ST 2086, HDR10 compatible / SMPTE ST 2086
Codec ID                                 : dvh1
Duration                                 : 2 min 1 s
Bit rate                                 : 12.1 Mb/s
Maximum bit rate                         : 30.8 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
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.061
Stream size                              : 176 MiB (85%)
Title                                    : hevc@GPAC2.1-DEV-rev321-gc68d8a53-master
Encoded date                             : UTC 2022-10-05 01:59:51
Tagged date                              : UTC 2022-10-05 01:59:52
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
mdhd_Duration                            : 121830
Codec configuration box                  : hvcC+dvcC
Can you point me to the place in the code where the final mp4box settings are for the Apple TV mux with AC3? It will work if I manually set the fps with mp4box, I can't seem to figure out why its pulling the incorrect fps from the stream.
RESET_9999
Posts: 2090
Joined: Mon Aug 05, 2019 7:12 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by RESET_9999 »

johnjon94 wrote:
Wed Oct 05, 2022 2:10 am
Can you point me to the place in the code where the final mp4box settings are for the Apple TV mux with AC3? It will work if I manually set the fps with mp4box, I can't seem to figure out why its pulling the incorrect fps from the stream.
tell me how to set the fps with mp4box and I'll make the process automatic.

line 19287 if input is 1 video 1 lossy audio and 1 srt

Code: Select all

"%mp4box2_path%" -add %BL%%mbox% -add %audio% -add %subtitles_path% -tmp %TEMP% "%output_path%%filename%_DoVi.sub.DD.mp4"
sw5163
Posts: 146
Joined: Sat Jun 25, 2022 7:28 am

Re: Dolby Vision now possible through MP4 Mux.

Post by sw5163 »

RESET_9999 wrote:
Wed Oct 05, 2022 2:02 am
hdr=none
we tested on appletv and LPCM audio didn't work when using it
lol, apple is hilarious
johnjon94
Posts: 35
Joined: Thu Nov 11, 2021 5:59 am

Re: Dolby Vision now possible through MP4 Mux.

Post by johnjon94 »

RESET_9999 wrote:
Wed Oct 05, 2022 2:15 am
johnjon94 wrote:
Wed Oct 05, 2022 2:10 am
Can you point me to the place in the code where the final mp4box settings are for the Apple TV mux with AC3? It will work if I manually set the fps with mp4box, I can't seem to figure out why its pulling the incorrect fps from the stream.
tell me how to set the fps with mp4box and I'll make the process automatic.

line 19287 if input is 1 video 1 lossy audio and 1 srt

Code: Select all

"%mp4box2_path%" -add %BL%%mbox% -add %audio% -add %subtitles_path% -tmp %TEMP% "%output_path%%filename%_DoVi.sub.DD.mp4"
It goes directly after the hevc input file like this

Code: Select all

mp4box -add "input.hevc:fps=24000/1001"
RESET_9999
Posts: 2090
Joined: Mon Aug 05, 2019 7:12 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by RESET_9999 »

johnjon94 wrote:
Wed Oct 05, 2022 2:19 am
It goes directly after the hevc input file like this

Code: Select all

mp4box -add "input.hevc:fps=24000/1001"
thanks. next version will set a fps all the time regardless of if the input is appleTV web-dl or not
RESET_9999
Posts: 2090
Joined: Mon Aug 05, 2019 7:12 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by RESET_9999 »

johnjon94 wrote:
Wed Oct 05, 2022 2:19 am
try this: https://drive.google.com/file/d/1rhF3Od ... sp=sharing

only support 23.976/24/25 fps for now.. will add more in the official 1.6.1
johnjon94
Posts: 35
Joined: Thu Nov 11, 2021 5:59 am

Re: Dolby Vision now possible through MP4 Mux.

Post by johnjon94 »

RESET_9999 wrote:
Wed Oct 05, 2022 2:46 am
johnjon94 wrote:
Wed Oct 05, 2022 2:19 am
try this: https://drive.google.com/file/d/1rhF3Od ... sp=sharing

only support 23.976/24/25 fps for now.. will add more in the official 1.6.1
This version seems to work great at detecting the correct FPS. I can see right now that its displaying the correct 24000/1001 when importing the HEVC file. However for the subtitles it isn't setting any language for them, and the first subtitle which is forced isn't displaying the Forced tag.

Code: Select all

Text #1
ID                                       : 3
Format                                   : Timed Text
Codec ID                                 : tx3g
Duration                                 : 1 h 28 min
Bit rate mode                            : Variable
Bit rate                                 : 0 b/s
Frame rate                               : 0.004 FPS
Stream size                              : 269 Bytes (0%)
Forced                                   : No

Text #2
ID                                       : 4
Format                                   : Timed Text
Codec ID                                 : tx3g
Duration                                 : 1 h 51 min
Bit rate mode                            : Variable
Bit rate                                 : 117 b/s
Frame rate                               : 0.812 FPS
Stream size                              : 95.7 KiB (0%)
Forced                                   : No


One thing I'd recommend adding in the official version is to include chapter files if they exist in the MKV file. Just as easy as adding any other track with

Code: Select all

-add chapters.txt
RESET_9999
Posts: 2090
Joined: Mon Aug 05, 2019 7:12 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by RESET_9999 »

yes I know. it is on my todo list since @sw5163 told me about it..
I just dont care much about the mp4 workflows because i dont use them. TS container is much better than mp4.
johnjon94
Posts: 35
Joined: Thu Nov 11, 2021 5:59 am

Re: Dolby Vision now possible through MP4 Mux.

Post by johnjon94 »

RESET_9999 wrote:
Wed Oct 05, 2022 3:03 am
I can't seem to get the fake P5 to play on Apple TV through Plex or directly. Doesn't seem to play on my computer either, just a black screen. I'm curious if there's just a small codec misconfiguration.

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, dvhe.05.06, BL+RPU, HDR10 compatible / SMPTE ST 2086, HDR10 compatible / SMPTE ST 2086
Codec ID                                 : dvh1
Duration                                 : 1 h 51 min
Source duration                          : 1 h 52 min
Bit rate                                 : 24.3 Mb/s
Maximum bit rate                         : 46.6 Mb/s
Width                                    : 3 832 pixels
Height                                   : 1 574 pixels
Display aspect ratio                     : 2.40:1
Frame rate mode                          : Constant
Frame rate                               : 23.976 (24000/1001) FPS
Original frame rate                      : 0.729 FPS
Standard                                 : NTSC
Chroma subsampling                       : 4:2:0
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.168
Stream size                              : 19.0 GiB (97%)
Source stream size                       : 19.0 GiB (97%)
Title                                    : ?@GPAC2.1-DEV-rev321-gc68d8a53-master
Encoded date                             : UTC 2022-10-05 02:52:44
Tagged date                              : UTC 2022-10-05 02:54:42
Color range                              : Limited
Mastering display color primaries        : BT.2020
Mastering display luminance              : min: 0.0050 cd/m2, max: 1000 cd/m2
Maximum Content Light Level              : 1190 cd/m2
Maximum Frame-Average Light Level        : 412 cd/m2
mdhd_Duration                            : 6721756
Codec configuration box                  : hvcC+dvcC

Audio
ID                                       : 2
Format                                   : E-AC-3 JOC
Format/Info                              : Enhanced AC-3 with Joint Object Coding
Commercial name                          : Dolby Digital Plus with Dolby Atmos
Codec ID                                 : ec-3
Duration                                 : 1 h 52 min
Bit rate mode                            : Constant
Bit rate                                 : 768 kb/s
Maximum bit rate                         : 811 kb/s
Channel(s)                               : 6 channels
Channel layout                           : L R C LFE Ls Rs
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Compression mode                         : Lossy
Stream size                              : 615 MiB (3%)
Title                                    : ec3@GPAC2.1-DEV-rev321-gc68d8a53-master
Service kind                             : Complete Main
Default                                  : Yes
Alternate group                          : 1
Encoded date                             : UTC 2022-10-05 02:54:39
Tagged date                              : UTC 2022-10-05 02:54:42
Complexity index                         : 16
Number of dynamic objects                : 15
Bed channel count                        : 1 channel
Bed channel configuration                : LFE

Text #1
ID                                       : 3
Format                                   : Timed Text
Codec ID                                 : tx3g
Duration                                 : 1 h 28 min
Bit rate mode                            : Variable
Bit rate                                 : 0 b/s
Frame rate                               : 0.004 FPS
Stream size                              : 269 Bytes (0%)
Title                                    : forced.srt@GPAC2.1-DEV-rev321-gc68d8a53-master
Forced                                   : No
Encoded date                             : UTC 2022-10-05 02:54:42
Tagged date                              : UTC 2022-10-05 02:54:42

Text #2
ID                                       : 4
Format                                   : Timed Text
Codec ID                                 : tx3g
Duration                                 : 1 h 51 min
Bit rate mode                            : Variable
Bit rate                                 : 117 b/s
Frame rate                               : 0.812 FPS
Stream size                              : 95.7 KiB (0%)
Title                                    : srt@GPAC2.1-DEV-rev321-gc68d8a53-master
Forced                                   : No
Encoded date                             : UTC 2022-10-05 02:54:42
Tagged date                              : UTC 2022-10-05 02:54:42
RESET_9999
Posts: 2090
Joined: Mon Aug 05, 2019 7:12 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by RESET_9999 »

idk, i dont have any apple device... @ragico did all the testing when I did the apple workflows.
the only difference is the latest mp4box...
the cmd is the same i showed you before.

Code: Select all

"%mp4box2_path%" -add %BL%%mbox% -add %audio% -add %subtitles_path% -tmp %TEMP% "%output_path%%filename%_DoVi.sub.DD.mp4"
Last edited by RESET_9999 on Wed Oct 05, 2022 3:47 am, edited 1 time in total.
RESET_9999
Posts: 2090
Joined: Mon Aug 05, 2019 7:12 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by RESET_9999 »

are you sure its not your source again?

Original frame rate : 0.729 FPS

did you fix the fps bitstream with ffmpeg on that file? because i noticed that it cause some playback issue on my TV
johnjon94
Posts: 35
Joined: Thu Nov 11, 2021 5:59 am

Re: Dolby Vision now possible through MP4 Mux.

Post by johnjon94 »

RESET_9999 wrote:
Wed Oct 05, 2022 3:43 am
are you sure its not your source again?

Original frame rate : 0.729 FPS

did you fix the fps bitstream with ffmpeg on that file? because i noticed that it cause some playback issue on my TV
Yeah I used bitstream filters with ffmpeg to fix the fps. These files play with no issue on my television normally and with any other player I've tried them on.
johnjon94
Posts: 35
Joined: Thu Nov 11, 2021 5:59 am

Re: Dolby Vision now possible through MP4 Mux.

Post by johnjon94 »

RESET_9999 wrote:
Wed Oct 05, 2022 3:43 am
I've figured out the issue, its the demuxer that you're using. This is also why the framerate wasn't being pulled correctly, and I noticed for ATVP files that it wasn't demuxing with the accurate aspect ratio.

eac3to:

Code: Select all

 Track Importing HEVC - Width 3832 Height 1574
ffmpeg/tsmuxer:

Code: Select all

Track Importing HEVC - Width 3838 Height 1606
After demuxing with ffmpeg instead of eac3to then running the mp4box command the resulting file played with no issue and retained the aspect ratio and framerate. (And confirmed that Plex for Apple TV is triggering Dolby Vision and Atmos as well as the internal Plex app for LG C2)

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, dvhe.05.06, BL+RPU / SMPTE ST 2086, HDR10 compatible
Codec ID                                 : dvh1
Duration                                 : 1 h 52 min
Bit rate                                 : 24.2 Mb/s
Maximum bit rate                         : 46.6 Mb/s
Width                                    : 3 838 pixels
Height                                   : 1 606 pixels
Display aspect ratio                     : 2.40:1
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
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.164
Stream size                              : 19.0 GiB (97%)
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : BT.2020
Mastering display luminance              : min: 0.0050 cd/m2, max: 1000 cd/m2
Maximum Content Light Level              : 1190 cd/m2
Maximum Frame-Average Light Level        : 412 cd/m2
mdhd_Duration                            : 6721424
Codec configuration box                  : hvcC+dvcC

Audio
ID                                       : 2
Format                                   : E-AC-3 JOC
Format/Info                              : Enhanced AC-3 with Joint Object Coding
Commercial name                          : Dolby Digital Plus with Dolby Atmos
Codec ID                                 : ec-3
Duration                                 : 1 h 52 min
Bit rate mode                            : Constant
Bit rate                                 : 768 kb/s
Maximum bit rate                         : 811 kb/s
Channel(s)                               : 6 channels
Channel layout                           : L R C LFE Ls Rs
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Compression mode                         : Lossy
Stream size                              : 615 MiB (3%)
Language                                 : English
Service kind                             : Complete Main
Complexity index                         : 16
Number of dynamic objects                : 15
Bed channel count                        : 1 channel
Bed channel configuration                : LFE

Text
ID                                       : 3
Format                                   : Timed Text
Codec ID                                 : tx3g
Duration                                 : 1 h 51 min
Bit rate mode                            : Variable
Bit rate                                 : 117 b/s
Frame rate                               : 0.812 FPS
Stream size                              : 95.7 KiB (0%)
Title                                    : SDH
Language                                 : English
Forced                                   : No
sw5163
Posts: 146
Joined: Sat Jun 25, 2022 7:28 am

Re: Dolby Vision now possible through MP4 Mux.

Post by sw5163 »

johnjon94 wrote:
Wed Oct 05, 2022 3:24 am
I can't seem to get the fake P5 to play on Apple TV through Plex or directly. Doesn't seem to play on my computer either, just a black screen. I'm curious if there's just a small codec misconfiguration.
Some demo files:
https://drive.google.com/drive/folders/ ... Ps8NfU53Ee
Some audio test files:
https://drive.google.com/drive/folders/ ... F22-4q1qTe
Post Reply