Example of stuttering HEVC playback on Apple TV 4K

For anyone that has a bunch of videos to fix, here’s the bash script I wrote. You must have mkvmerge and ffmpeg installed. Cd into a folder that contains faulty mp4s or subdirectories with faulty mp4s. It will recursively search for and process any mp4 it finds, create a tmp video file and a temp audio and subtitle file, then recombine them into a new mkv file that contains all of the video, audio, and subtitle tracks as the original. There is no re-encoding, just remuxing the files, so no loss of quality and the resulting file is the same size as the original. Also, it does delete the tmp files it creates, but it leaves the original mp4 files untouched. I prefer to delete those by hand once I know everything is working good. If you prefer mp4s, you can modify it to spit out mp4s, however you can’t periodically run it on the same set of folders without it needless processing the same files over and over again. To mitigate the issue with these mp4 files, I just process all mp4s so they will work regardless of whether or not they had a problem originally.

Naturally, use this at your own risk. It has worked perfectly for me, however I have not tried it on every single .mp4 files out there, and I can’t be held responsible for whatever happens.

3 Likes