Extracting subtitles from mp4

vector picture vector · Jun 30, 2013 · Viewed 20.5k times · Source

I got an assignment of retrieving subtitles from a mp4 file

I want to know how to do this, by java or c++, does it depends on mp4 encoding format and

I want to know the basic concepts of different video formats and basic concepts of video processing.

Answer

alexbuisson picture alexbuisson · Jul 11, 2013

there is several subtitle format, SRT, STL(mainly use by Apple), etc.... and ffmpeg support a lot of them http://ffmpeg.org/general.html#Subtitle-Formats

and ffmpeg can extract them with cmd line the following sequence of command:

1) perform track identification

ffmpeg -i yourFile

2) extract the subtitle track with

ffmpeg -i yourFile -vn -an -codec:s:X.Y srt 
sub.srt

with X.Y the track number indicator you found from the cmd (1) .