Table of Contents

Extracting Subtitles from MP4 Files

By Colin on 2019-07-01

Let's say you've got a video file on hand with baked-in subtitles. No matter what you try, your casting software just can't convince ChromeCast to utilize those subs. What's a man to do?

Below is a quick guide to solve this.

Extraction via MP4Box

MP4Box can extract subtitles reliably. On Arch Linux, it's a binary included in the gpac package. Before we can extract subtitles, let's analyse our file:

MP4Box -info video.mp4

This will highlight all the video, audio, and subtitles "tracks" within the file. If our target subtitle track were "Track 4", then to extract it:

MP4Box -raw 4 video.mp4

Conversion to .srt

Your subtitles may have been extracted as a pair of files: a .sub and a .idx. .srt is a more friendly, plain-text format that casting software can handle easier. To convert, use this website.

Casting via catt

VLC has decent casting support, but often trips over subtitles. On the other hand, Catt supports these well. With your original .mp4 file and newly converted .srt in hand, we can begin casting with:

  catt cast -s ./subtitles.srt ./video.mp4

References

Blog Archive