1

Video output:

ffmpeg -i output.mkv

Input #0, matroska,webm, from 'output.mkv':

Metadata:

encoder : libebml v1.3.6 + libmatroska v1.4.9

creation_time : 2018-08-31T06:43:45.000000Z

Duration: 00:42:51.03, start: 0.000000, bitrate: 1928 kb/s

Stream #0:0: Video: h264 (Main), yuv420p(progressive), 960x540 [SAR 1:1 DAR 16:9], Closed Captions, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)

Using this:

"ffmpeg" -f lavfi -i "movie=output.mkv[out0+subcc]" -map s "output_map-s.srt"

I can extract the (CC) but with an odd time codes and tags.

1 00:00:00,019 --> 00:00:00,051 {\an7}dialogue

2 00:00:00,052 --> 00:00:00,134 {\an7}dialogue

3 00:00:00,135 --> 00:00:00,161 {\an7}dialogue

4 00:00:00,163 --> 00:00:00,178 {\an7}dialogue

5 00:00:00,179 --> 00:00:00,194 {\an7}dialogue

6 00:00:00,220 --> 00:00:00,246 {\an7}dialogue

7 00:00:00,272 --> 00:00:00,296 {\an7}-dialogue

What would be the correct sentence to extract synced (CC).

thanks.

0

This worked for me, N is the subtitle index starting with 0:

ffmpeg -hide_banner -i myfile.mkv -map 0:s:N subtiles_N.srt
  • You have to replace N with a number, because the MKV can have multiple subtiles. This will get you the first subtitle: ffmpeg -hide_banner -i myfile.mkv -map 0:s:0 subtiles_zero.srt – Cesar Moore Sep 12 '18 at 15:46
  • Get the same error... – sard Sep 12 '18 at 15:55
  • It can't be the exact same error, if it is ''0:s:0' matches no streams.', it would be because the MKV has not subtitles. – Cesar Moore Sep 12 '18 at 16:25
  • The second answer here, uses the same approach: superuser.com/questions/391892/extract-subtitles-from-movie (it has 3 votes) – Cesar Moore Sep 12 '18 at 16:38
  • Thank you, but this works only with subtitles with their own streams: Stream #0:2: Subtitle: subrip (default). Not Close Caption encoded in video stream. – sard Sep 12 '18 at 17:16

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.