############### TOOLS ###############
DVDFab (11.0.3.9 or newer) (
HERE)
FFmpeg (
HERE)
mp4muxer (
HERE)
mp4box (from GPAC SDK) (
HERE)
GPAC.exe can be unzipped using 7zip: binary files are located in the "bin" folder.
######### "DUAL LAYER" DOLBY VISION: THEORY #########
Use FFmpeg to demux the video Base layer (BL), the video Enhancement layer (EL) and the audio stream. The audio stream will be also copied/encoded and stored in the right container (see APPENDIX A).
For testing purpose, I suggest you work on 60 seconds cuts. See APPENDIX B.
Use mp4muxer to mux BL and EL (without audio).
Use mp4box to mux the "Dual Layer" .mp4 file (generated by mp4muxer) and the audio stream (generated by FFmpeg).
# "DUAL LAYER" DOLBY VISION: REAL CASE SCENARIO (example with ATMOS) #
Make your choice:
- #EXPERIMENTAL# if your setup can handle tracks with TrueHD/ATMOS encoding
Code: Select all
ffmpeg.exe -i bluray:\path\to\bluray -map 0:0 -c copy %userprofile%\Desktop\BL.hevc -map 0:1 -c copy %userprofile%\Desktop\EL.hevc -map 0:2 -c:a copy -strict -2 %userprofile%\Desktop\atmos.mp4
- otherwise, if your setup does not handle tracks with TrueHD/ATMOS encoding (or the previous method does not work for you)
Code: Select all
ffmpeg.exe -i bluray:\path\to\bluray -map 0:0 -c copy %userprofile%\Desktop\BL.hevc -map 0:1 -c copy %userprofile%\Desktop\EL.hevc -map 0:2 -c:a pcm_s24be -ar 48000 -rf64 auto %userprofile%\Desktop\lpcm.mov
Code: Select all
mp4muxer_64bits.exe --dv-profile 7 --input-file %userprofile%\Desktop\BL.hevc --input-file %userprofile%\Desktop\EL.hevc --output-file %userprofile%\Desktop\mp4muxer_out.mp4
Code: Select all
mp4box.exe -add %userprofile%\Desktop\mp4muxer_out.mp4:rate=0 -add %userprofile%\Desktop\atmos.mp4:disable -brand mp42isom -ab dby1 -no-iod %userprofile%\Desktop\mp4box_out.mp4
- Enter the appropriate file (atmos.mp4 or lpcm.mov) in the last command line based on the choice made previously.
- Note the syntax --> -add stream[:opt1:...:optN]
######### "SINGLE LAYER" DOLBY VISION: THEORY #########
Use DVDFab to generate a "Sigle Layer" .mp4 file (choose the "single layer" profile, deselect any optimization settings and export the file without any audio track)
Use FFmpeg to demux the audio stream. The audio stream will be also copied/encoded and stored in the right container (see APPENDIX A).
Use mp4box to mux the "Single Layer" .mp4 file (generated by DVDFab) and the audio stream (generated by FFmpeg).
# "SINGLE LAYER" DOLBY VISION: REAL CASE SCENARIO (example with ATMOS) #
Code: Select all
Use DVDFab as indicated above and generate an .mp4 file (dvdfab_out.mp4)
Make your choice:
- #EXPERIMENTAL# if your setup can handle tracks with TrueHD/ATMOS encoding
Code: Select all
ffmpeg.exe -i bluray:\path\to\bluray -map 0:2 -c:a copy -strict -2 %userprofile%\Desktop\atmos.mp4
- otherwise, if your setup does not handle tracks with TrueHD/ATMOS encoding (or the previous method does not work for you)
Code: Select all
ffmpeg.exe -i bluray:\path\to\bluray -map 0:2 -c:a pcm_s24be -ar 48000 -rf64 auto %userprofile%\Desktop\lpcm.mov
Code: Select all
mp4box.exe -add %userprofile%\Desktop\dvdfab_out.mp4 -add %userprofile%\Desktop\atmos.mp4 -brand mp42isom -ab dby1 %userprofile%\Desktop\mp4box_out.mp4
- Enter the appropriate file (atmos.mp4 or lpcm.mov) in the last command line based on the choice made previously.
############### APPENDIX A ###############
### How to use ffmpeg for our purposes ###
Code: Select all
ffmpeg INPUT MAP_OPTION ENCODING_SETTINGS OUTPUT_TYPE
### How to find the correct stream id (MAP_OPTION) ###
Output example
Code: Select all
Stream #0:0[0x1011]: Video: hevc (Main 10) (HDMV / 0x564D4448), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x2160 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn, 23.98 tbc
Stream #0:1[0x1015]: Video: hevc (Main 10) (HDMV / 0x564D4448), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn, 23.98 tbc
Stream #0:2[0x1100]: Audio: truehd (AC-3 / 0x332D4341), 48000 Hz, 7.1, s32 (24 bit)
Stream #0:3[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), fltp, 640 kb/s
### Map option, Encoding settings and Output type for different audio formats ###
# "DTS family" (lossy and lossless, DTS:X included) #
Code: Select all
-map 0:AUDIO_STREAM_ID -c copy \path\to\audio.mp4
# TrueHD/ATMOS # #EXPERIMENTAL# (Take a look at this POST)
Code: Select all
-map 0:AUDIO_STREAM_ID -c copy -strict -2 \path\to\audio.mp4
#If your setup does not handle tracks with TrueHD/ATMOS or DTS-HD MA / DTS: X encoding and you still want to maintain a high sound quality or simply want to reduce the size of the audio track#
LPCM (Apple ecosystem)
Code: Select all
-map 0:AUDIO_STREAM_ID -c pcm_s24be -ar 48000 -rf64 auto \path\to\audio.mov
LPCM (Rest of the world)
Code: Select all
-map 0:AUDIO_STREAM_ID -c pcm_s24le -ar 48000 -rf64 auto \path\to\audio.mov
FLAC (the "-compression_level" parameter accepts values from 0 to 12)
Code: Select all
-map 0:AUDIO_STREAM_ID -c flac -compression_level 0 \path\to\audio.flac
μ-LAW
Code: Select all
-map 0:AUDIO_STREAM_ID -c pcm_mulaw \path\to\audio.mov
A-LAW
Code: Select all
-map 0:AUDIO_STREAM_ID -c pcm_alaw \path\to\audio.mov
Based on quality produced from high to low:
############### APPENDIX B ###############
How to generate cuts (60 seconds) using ffmpeg (example with ATMOS audio track)
Code: Select all
ffmpeg -ss 0 -i bluray:\path\to\bluray -t 60 -map 0:BL_STREAM_ID -c copy %userprofile%\Desktop\BL.hevc
ffmpeg -ss 0 -i bluray:\path\to\bluray -t 60 -map 0:EL_STREAM_ID -c copy %userprofile%\Desktop\EL.hevc
ffmpeg -ss 0 -i bluray:\path\to\bluray -t 60 -map 0:ATMOS_STREAM_ID -c:a pcm_s24be -ar 48000 -rf64 auto %userprofile%\Desktop\lpcm.mov