I have a couple of movie files from different sources where some files exhibit one or two of three issues:
- The audio tracks are mangled (being played all at once)
- The Dolby Vision metadata is not interpreted properly
- The HEVC tag does not play on a Mac (tag hev1 vs hvc1)
I solved problems 1 and 2 with the following ffmpeg command (-strict and -disposition options):
ffmpeg -y -i input.mp4 -map 0 -c copy -strict unofficial -disposition:a:0 0 -disposition:a:1 default output.mp4
Problem 2 (which affects different files) can be solved by modifying the HEVC tag:
ffmpeg -y -i input.mp4 -c:v copy -tag:v:0 hvc1 -c:a copy -c:s copy -map 0 output.mp4
Now I have a file which has all three issues, and it is also marked as “HEVC (Parameter Sets in Bitstream) Dolby Vision 5.0” (instead of “HEVC Dolby Vision 5.0” as the other files). No combination of the commands quoted above seems to work, and I am not familiar enough with video codecs to figure out a solution. Just changing the tag with the -tag option results in an unreadable file, for which ffprobe displays the following error message:
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x70d028000] stream 0, timescale not set
[extract_extradata @ 0x70d0b8280] No start code is found.
input.mp4: Invalid data found when processing input
I am grateful for any pointers to a solution.