Neither of the other answers here worked for me with an m.m4v
containing multiple subtitles. But the following did work (with both .m4v and .mp4 files):
ffmpeg -i m.m4v -map 0:s:0 eng.srt
ffmpeg -i m.m4v -map 0:s:1 ita.srt
ffmpeg -i m.m4v -map 0:s:2 fre.srt
In my m.m4v
are 3 subtitle streams with English being the first, Italian the second, French the third. It appears to be the order that's used for the ffmpeg command rather than the X.Y
(input.stream) values one obtains with ffmpeg -i m.m4v
which for my m.m4v
gave:
Stream #0:2(eng): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s (default)
Metadata:
handler_name : SubtitleHandler
Stream #0:3(ita): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s
Metadata:
handler_name : SubtitleHandler
Stream #0:4(fre): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s
Metadata:
handler_name : SubtitleHandler
I'm using Mac OS 10.4.5 on a Macbook Pro 2015
By the way, if there's only one subtitle track then you would use:
ffmpeg -i m.m4v -map 0:s:0 sub.srt