Page 1 of 3 123 LastLast
Results 1 to 10 of 30

Thread: Combine MKV file with SRT file?

  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
    Mar 2007
    Location
    Portsmouth, UK
    Beans
    Hidden!
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: Combine MKV file with SRT file?

    Spaces in the file name "Jab Tak Hai Jaan 2012.mkv"

    Try "Jab\ Tak\ Hai\ Jaan\ 2012.mkv" (or just use tab).

  8. #8
    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 Grenage View Post
    Spaces in the file name "Jab Tak Hai Jaan 2012.mkv"

    Try "Jab\ Tak\ Hai\ Jaan\ 2012.mkv" (or just use tab).
    The original file name is Jab Tak Hai Jaan (2012), but when I tried that it gave me and error with something about the parentheses. How do I write it properly?
    Question Everything

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

    Re: Combine MKV file with SRT file?

    Got this:

    Code:
    shadius@shadius-phantom:~$ ffmpeg -i Jab\ Tak\ Hai\ Jaan.mkv Jab\ Tak\ Hai\ Jaan.srt -map 0 -map 1 -copy JTHJ.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 Tak Hai Jaan.mkv: No such file or directory
    shadius@shadius-phantom:~$
    I renamed the file name to Jab Tak Hai Jaan.mkv but it's still saying there's no such file or directory. What am I doing wrong?
    Question Everything

  10. #10
    Join Date
    Mar 2007
    Location
    Portsmouth, UK
    Beans
    Hidden!
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: Combine MKV file with SRT file?

    Quote Originally Posted by Shadius View Post
    Jab Tak Hai Jaan.mkv: No such file or directory
    Are you absolutely sure that's the name? For the record, this is why most files in certain scenes (especially Linux) will use periods instead of spaces; underscores are also common.

    Just for fun, call it something short and sweet. Failing that, show us the output of the ls command, when in the relevant directory.

Page 1 of 3 123 LastLast

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
  •