Results 1 to 10 of 30

Thread: Combine MKV file with SRT file?

Hybrid View

  1. #1
    Join Date
    Apr 2008
    Location
    USA
    Beans
    1,122
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Question Combine MKV file with SRT file?

    Hey all,

    I have a video file in .mkv format and the subtitles file in .srt format. I want to combine the two instead of having two separate files like how it is now. Is there a way to do this? I want it so when I'm playing the video I can choose to enable subtitles or not. Thanks for the help.
    Question Everything

  2. #2
    Join Date
    Oct 2010
    Location
    London
    Beans
    482
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Combine MKV file with SRT file?

    From the command-line, you can do this with either FFmpeg or MKVmerge (part of mkvtoolsnix)

    Code:
    ffmpeg -i movie.mkv subtitle.srt -map 0 -map 1 -c copy output.mkv
    
    ##  or
    
    mkvmerge -o output.mkv input.mkv subtitle.srt

  3. #3
    Join Date
    Apr 2008
    Location
    USA
    Beans
    1,122
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Combine MKV file with SRT file?

    Quote Originally Posted by evilsoup View Post
    From the command-line, you can do this with either FFmpeg or MKVmerge (part of mkvtoolsnix)

    Code:
    ffmpeg -i movie.mkv subtitle.srt -map 0 -map 1 -c copy output.mkv
    
    ##  or
    
    mkvmerge -o output.mkv input.mkv subtitle.srt
    Thank you for replying. Is this a long process and just to be clear, where it says: "movie.mkv subtitle.srt", I'd use the name of the movie file and subtitle file, right?
    Question Everything

  4. #4
    Join Date
    Oct 2010
    Location
    London
    Beans
    482
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Combine MKV file with SRT file?

    Yes, replace movie.mkv and subtitle.srt with the names of your files (and output.mkv with whatever you want your output file to be called - note that you can't directly overwrite your input file with these commands, though when it's finished you can simply delete the input files). And this should take around the same amount of time as copying files from one location to another would.

  5. #5
    Join Date
    Apr 2008
    Location
    USA
    Beans
    1,122
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Combine MKV file with SRT file?

    Quote Originally Posted by evilsoup View Post
    Yes, replace movie.mkv and subtitle.srt with the names of your files (and output.mkv with whatever you want your output file to be called - note that you can't directly overwrite your input file with these commands, though when it's finished you can simply delete the input files). And this should take around the same amount of time as copying files from one location to another would.
    Thank you very much for clarifying. I'm going to go try it now.
    Question Everything

  6. #6
    Join Date
    Apr 2008
    Location
    USA
    Beans
    1,122
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Combine MKV file with SRT file?

    This is the output:

    Code:
    shadius@shadius-phantom:~$ ffmpeg -i Jab Tak Hai Jaan 2012.mkv Jab Tak Hai Jaan.srt -map 0 -map 1 -c copy output.mkv
    ffmpeg version 0.8.5-4:0.8.5-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
      built on Jan 24 2013 18:01:36 with gcc 4.6.3
    *** THIS PROGRAM IS DEPRECATED ***
    This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
    Jab: No such file or directory
    shadius@shadius-phantom:~$
    Question Everything

  7. #7
    Join Date
    Jan 2009
    Location
    ::1
    Beans
    2,485

    Re: Combine MKV file with SRT file?

    Quote Originally Posted by evilsoup View Post
    Code:
    mkvmerge -o output.mkv input.mkv subtitle.srt
    Wow ... it only took 39 seconds to merge in the subtitles:

    Code:
    The file 'output.mkv' has been opened for writing.
    Progress: 100%
    The cue entries (the index) are being written...
    Muxing took 39 seconds.
    Thank you very much!

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •