Trimming .m4v files in QuickTime X with subtitles

When you trim a .m4v video in QuickTime X that has subtitles embedded (by using Handbrake for instance) you’ll run into a problem that Quicktime X Player will no longer recognize the subtitle stream. When you copy the .m4v file to an iPad the subtitles will work again but do no longer indicate their correct language.

Fortunately there’s an easy fix as the problem lies in the metadata. The simpleĀ Subler application allows you to edit this metadata and restore your subtitles. Here’s how the metadata of a trimmed file will look:

You can see how all streams are set to an unknown language. The problem lies in the “Alternate group” flag which is set to none. If you set this flag to “2” and save your file, all will be good. When you’re at it, set the correct language for the audio and subtitle stream as well so Quicktime can display them properly.