blog.minskio.co.uk

Content and theme behind minskio.co.uk
Log | Files | Refs

dumping-subtitles-using-ffmpeg.md (1229B)


      1 ---
      2 title: "Dumping subtitles using FFmpeg"
      3 date: 2020-05-17T14:00:00
      4 tags: ["Formats", "Languages", "Linux", "Media", "Snippets", "Software"]
      5 ---
      6 
      7 As part of my ongoing [language learning](/languages/) attempts, I tend to enable subtitles in the language I'm wanting to learn, and when I see a word I don't recognise in the context I do I'll make a note of it.
      8 
      9 This manual approach though can get a bit tiresome, so if you want a quick way to dump an entire subtitle file from a video, you can do the following:
     10 ```
     11 ffmpeg -i video.mkv
     12 ```
     13 
     14 This will list the streams available, video, audio and subtitles if available. If labels are available it will show them here too. Make a note of the stream you want. In the above example, we're seeing `Stream #0:5(nor)` in our original command output which would be Norwegian. To dump this stream to a subrip `srt` file you'll run the following:
     15 ```
     16 ffmpeg -i video.mkv -c copy -map 0:5 subtitles.srt
     17 ```
     18 
     19 You should now have a single `srt` file with your subtitles as expected in them.
     20 
     21 I'll write another post for how to format these files to a usable list type format later.
     22 **Edit 2020-07-25:** [Follow up article posted here](/formatting-dumped-subtitles-into-a-vocabulary-list/).