All demo files are guaranteed to work with Apple’s native player, should also work on PLEX. They can also be directly played in Safari and have Dolby Vision.
9.1.6 eac3+atmos:
mp4box now supports atmos remux
mp4box -add dv.hevc -add atmos.ec3 -new p5_dvh1_eac3_atmos.mp4
1. mp4muxer to fix/generate proper atmos.mp4 with right “complexity index”:
mp4muxer -i atmos.ec3 -o atmos.mp4
2. mp4box to generate proper dvh1.mp4:
mp4box -add dv.hevc -new dvh1.mp4
3. mp4mux(bento4) to merge them:
mp4mux(bento4) --track dvh1.mp4 --track atmos.mp4 p5_dvh1_eac3_atmos.mp4
Note only Apple platform will have atmos problem regarding “complexity index”
All other devices are fine.
ICtCp profile 5 dvh1 mp4:
no further change needed.
ICtCp profile 5 dvhe:
-
ffmpeg -i p5.dvhe.mp4 -map 0:0 -c copy dv.hevc
//-map 0:0 refers to DV track.
if (mov_text sub in it)
{
-
ffmpeg -i p5.dvhe.mp4 -map 0:1 -map 0:3 -c copy audio_sub.mp4
//-map 0:1 refers to eac3/ac3, -map 0:3 refers to mov_text sub.
}
else if ( .srt/.ass sub is needed)
{
-
ffmpeg -i p5.dvhe.mp4 -i srt.srt -map 0:1 -map 1 -c copy -c:s mov_text -metadata:s language=eng audio_sub.mp4
//mov_text is the only sub codec for Apple’s native player. Maybe others can be recognized by PLEX.
//language field on both audio and sub are important for sub to default show up.
}
-
mp4box -add dv.hevc -add audio_sub.mp4 -new p5.dvh1.mp4
//mp4box change dvhe to dvh1 by default while preserving DV RPU data.
//note change ‘dvhe’ to ‘dvh1’ by only using hex editor will result in problem on iOS playback. GitHub - rixtox/mp4dovi will lead to black screen on iPad pro 2017.
Dual layer FEL dolby vision to Apple compatible BL+RPU+7.1 lossless:
DV proof around P455 and P460
7.1 lossless proof
-
ffmpeg -i FEL_test_for_AVS.m2ts -c copy -map 0:0 bl.hevc -map 0:1 -c copy el.hevc -map 0:2 -c pcm_s32le pcm.mov
//Apple only supports pcm 7.1 lossless. -
dovi_tool --edit-config fel_to_p81.json mux --bl bl.hevc --el el.hevc --discard
//mode 2 to convert to profile 8.1
//remove_mapping to remove reshaping data that processing 4:2:2 12bit FEL to 4:2:0 10bit HDR.
fel_to_p81.json:
{
"mode": 2,
"remove_mapping": true
}
-
mp4box -add BL_RPU.hevc -add pcm.mov:lang=eng -add srt.srt:lang=eng:hdlr=sbtl -new p5_BL_RPU_PCM(7.1).mp4
//lang=eng:hdlr=sbtl for sub to default show up.
//one can also use ffmpeg command for sub as above.
Single layer FEL dolby vision to Apple compatible BL+RPU+7.1 lossless:
-
dovi_tool --edit-config fel_to_p81.json convert BL_EL_RPU.hevc --discard
//rest as Dual layer FEL.
Dual layer MEL dolby vision to Apple compatible BL+RPU+7.1 lossless:
-
dovi_tool -m 2 mux --bl bl.hevc --el el.hevc --discard
//MEL is already HDR10 BL and doesn’t have reshaping data, so ‘remove_mapping’ is not needed, use default mode 2 in dovi_tool.
//rest as Dual layer FEL.
Single layer MEL dolby vision (p8.1) to Apple compatible BL+RPU+7.1 lossless:
-
dovi_tool -m 2 convert BL_EL_RPU.hevc --discard
//rest as Dual layer FEL.
HDR10 hev1 mkv/mp4:
-
ffmpeg -i hev1.mp4/mkv -map 0:0 -map 0:1 -map 0:2 -c copy -c:s mov_text -metadata:s language=eng -vtag hvc1 hvc1.mp4
//hvc1 for Apple native player compatibility.
Hybrid Profile 5 and HDR10 Blu-ray to get unofficial MEL:
- Extract dv.hevc from streaming P5.
ffmpeg -i p5.dvhe.mp4 -map 0:0 -c copy dv.hevc - Extract RPU and remove reshaping data that are used for ICtCp->HDR10.
dovi_tool -m 3 extract-rpu dv.hevc - Modify RPU frame to synchronize with Blu-ray BL. (optional)
dovi_tool editor -i RPU.bin -j modify_frame.json
modify_frame.json:
{
// List of frames or frame ranges to remove (inclusive)
// Frames are removed before the duplicate passes
"remove": [
"0-39"
],
// List of duplicate operations
"duplicate": [
{
// Frame to use as metadata source
"source": int,
// Index at which the duplicated frames are added (inclusive)
"offset": int,
// Number of frames to duplicate
"length": int
}
],
}
- Extract bl.hevc from Blu-ray.
ffmpeg -i BluRay.m2ts/mkv -map 0:0 -c copy bl.hevc - Inject RPU_modified.bin to bl.hevc.
dovi_tool inject-rpu -r RPU_modified.bin -i bl.hevc - Remux to mp4 with audio/sub/etc.
mp4box -add BL_RPU.hevc -add pcm.mov:lang=eng -add sub.srt:lang=eng:hdlr=sbtl -new P5_dvh1_BL_RPU.mp4
Also check @RESET_9999 's DoVi_Scripts under his signature, saves a lot of effort than typing in command line.