Extract subtitles from mp4 files using MP4Box


Quick tip to extract subtitles from mp4 with the tool MP4Box available on OSX/Linux

. In OSX, we use brew to install MP4Box.

When installed, type the next to get info from the video file:

MP4Box -info input.mp4

Track # 4 Info - TrackID 4 - TimeScale 1000
Media Duration 02:23:33.789 - Indicated Duration 02:23:33.789
Media Info: Language "Spanish; Castilian (spa)" - Type "sbtl:tx3g" - 204 samples
Unknown Text Stream
 Size 1280 x 80 - Translation X=0 Y=455 - Layer -1
    RFC6381 Codec Parameters: tx3g
Alternate Group ID 2
    All samples are sync
Example of a subtitle's track

Now we look for the Track we want to extract (with the type sbtl:tx3g). If there are several, look for "samples" which are the lines that has the subtitle file. If the sample number are short, you are generally forced subtitles with important content as names, other languages ... Now we pass the ID of the track to the next instruction:

MP4Box -srt  Input.mp4 
MP4Box -srt 4 input.mp4 # Example

I request your permission to obtain statistical data on its navigation on this website. If you continue to browse I consider you accept the use of cookies. This site is adapted to be compliant with the new law about General Data Protection Regulation. OK | More Information