Segue abaixo um tutorial:
For a rip that lives in a Matroska (.mkv) container and includes:
- A video stream of 59.8 Mb/s Single Layer Dolby Vision Profile 7 HEVC
- An audio stream of Dolby TrueHD with Dolby Atmos
- An audio stream of Dolby Digital in EAC3
- Various subtitles in S_HDMV/PGS
In order to achieve proper Dolby Vision and Dolby audio playback on the
LG C2, we need to have an
MP4 container with video stream in Dolby Vision
Profile 5 or
8.1 or
8.4 (Profile 7 not supported), an audio stream of
Dolby Digital / Plus (TrueHD not supported) and the subtitles in a text format like SRT / MOV_TXT.
After a lot of research and trial & error, these are the demuxing / converting / remuxing steps I make to have this beauty playback successfully:
Tools needed:
ffmpeg,
dovi_tool,
MP4Box / GPAC
ffmpeg -y -i 'path_to.mkv' -dn -c:v copy -vbsf hevc_mp4toannexb -f hevc - | dovi_tool -m 2 convert --discard - -o 'path_to.hevc'
This will
demux the HEVC video stream from the MKV and simultaneously feed it in a compatible format to the
dovi_tool input that will in turn
convert the Dolby Vision Profile 7 RPU to Dolby Vision Profile 8 and discard the EL while saving it to a file on the disk.
MP4Box -add 'path_to.hevc':dvp=8.1:xps_inband:hdr=none -brand mp42isom -ab dby1 -no-iod -enable 1 'path_to.mp4' -tmp '/path_to_tmp folder/'
This will
remux the Dolby Vision Profile 8.1 HEVC video stream
only, into a properly Dolby Vision tagged MP4 file
ffmpeg -y -i 'path_to.mkv' -map "0:10" -c:s copy 'path_to.sup'
This will
demux the PGS subtitle stream and save it to a file on the disk. Note that the "0:10" is valid for my preference, as I just wanted the greek language subtitles. It may vary for you.
After that step I had to use a tool like
pgs-to-srt.com to optically convert the PGS subtitles to SRT.
ffmpeg -y -i 'path_to_hevc.mp4' -i 'path_to.mkv' -i 'path_to.srt' -loglevel error -stats -map "0:v?" -map "1:a:1" -map "2:s?" -dn -map_chapters 0 -movflags +faststart -c:v copy -c:a copy -c:s mov_text -metadata title="Movie Title (2023)" -metadata:s:v:0 handler_name="HEVC HDR10 / Dolby Vision" -metadata:s:a:0 handler_name="EAC3 5.1 Dolby Atmos" -metadata:s:s:0 language=ell -metadata:s:s:0 handler_name="MPEG-4 Timed Text" -strict experimental 'path_to_final.mp4'
This will use ffmpeg to do the
final remux of the
Dolby Vision Profile 8.1 HEVC (and also import the chapters from that), the
EAC3 Audio Track from the MKV and the
SRT into an MP4 container that is tagged correctly for Dolby Vision and playbacks flawlessly on the LG C2.
Note that you must use
ffmpeg 6.0 or later, select your own language codes, select and map the appropriate audio track from the MKV, put the correct Title name metadata for the streams etc.