I need to stitch together MKV files. Free. It shouldn't be this hard.
October 13, 2020 10:43 AM   Subscribe

I need to merge together MKV files on a windows computer (not online because these are confidential work files.) There must be a free program that does this, but my googling throws up only online solutions. Generic "merge video" utilities don't seem to do MKV. I should have been able to google this, but I can't find anything.
posted by If only I had a penguin... to Computers & Internet (13 answers total) 1 user marked this as a favorite
For free video manipulation, ffmpeg is hard to beat, although it's command line based. Here's the instructions on concatenating files with ffmpeg.

.mkv/Matroska is a container file format. The video content in the individual .mkv files might have different codecs (ways of encoding the actual videos). Given they're work files, it's possible they're all the same, but it's something to keep in mind regarding how you use ffmpeg - there are different instructions if the codecs are different.
posted by zamboni at 10:53 AM on October 13 [7 favorites]

VLC has functionality for converting files from 1 format to another, and I'm pretty sure MKV files is supported. So you can covert them to MP4 or some other more common format, merge (maybe in another app) and then convert back in VLC.
posted by The_Vegetables at 11:01 AM on October 13

If you have VLC, it's on the Media --> Convert/Save, and then on the next screen choose your file and then file type.
posted by The_Vegetables at 11:03 AM on October 13 [1 favorite]

Despite the name, Avidemux can do this without converting or re-encoding the files (assuming they are all encoded to the same specs to start with). Just open the first segment, then drag-n-drop each successive file onto it, then export with the audio & video codecs set to "Copy" and the container set to MKV.

If the files are not all encoded to the same specs (different resolutions, framerates, or codecs) then you will have to re-encode no matter what software you use, since the stream can't change formats midway through.
posted by CyberSlug Labs at 11:19 AM on October 13 [2 favorites]

FFmpeg is almost always the answer to Audio/Video "How Can I Do X?" questions. You usually just have to do a Google search for "how to do X ffmpeg" to find an answer. Many other apps use ffmpeg under the hood.

Here's a Windows GUI that might be of use: Home | QWinFF.
posted by zengargoyle at 11:33 AM on October 13 [5 favorites]

With VLC you should be able to create a playlist of the files, and then stream them to a new file as an output source.
posted by nickggully at 12:08 PM on October 13 [1 favorite]

FFmpeg is the answer, but it's an amazingly obnoxious and frustrating answer. The ffmprovisr library may help, specifically this recipe.
posted by humbug at 12:50 PM on October 13 [4 favorites]

Here's the ffmpeg command for combining eight files into one (since they're al l in the same file format that I want thie output to be) -- which I used only last week:
ffmpeg -i "concat:Cinderella-part1.VOB.mpg|Cinderella-part2.VOB.mpg|Cinderella-part3.VOB.mpg\
|Cinderella-part8.VOB.mpg" -c copy cinderella.mpg
(Pardon my line-breaks for legibility.)

It's not that hard, once you get over the initial hurdle of using a command line. :7) Finding good instructions can be daunting, though, I admit. This worked for me: https://trac.ffmpeg.org/wiki/Concatenate
posted by wenestvedt at 1:25 PM on October 13 [2 favorites]

I found LosslessCut to be fast, free, very simple, and perfect for my purposes. It'll both cut and join files. Not sure if will work for you, but definitely worth a look.

From the readme: "LosslessCut aims to be the ultimate cross platform ffmpeg GUI for extremely fast and lossless operations on video, audio, subtitle and other related media files. The main feature is lossless trimming and cutting of video and audio files, which is great for saving space by rough-cutting your large video files taken from a video camera, GoPro, drone, etc. It lets you quickly extract the good parts from your videos and discard many gigabytes of data without doing a slow re-encode and thereby losing quality."
posted by alexei at 2:09 PM on October 13 [2 favorites]

Every couple of years I try to find a good free Windows GUI video editing utility and every time I end up uninstalling all the promising candidates and just searching for the command line options to do what I want in ffmpeg. Not only does it produce high quality results reliably and quickly, it's also fairly simple to knock up batch scripts to perform the same operation across multiple files. It's madness that I'm still squinting at man pages after thirty years, but the damn thing just works.
posted by Busy Old Fool at 3:05 PM on October 13 [3 favorites]

+1 to Avidemux, it's become my go-to for this sort of thing.
posted by CrystalDave at 3:16 PM on October 13

I've been using MKVtoolnix to do that. It's simple to use and there's a GUI for Windows.
posted by elgilito at 4:59 PM on October 13 [2 favorites]

CyberSlug Labs: If the files are not all encoded to the same specs (different resolutions, framerates, or codecs) then you will have to re-encode no matter what software you use

Varying framerates can be accommodated. So can resolution with modern codecs (H.264, H.265) but few players support that.

Even different codecs are possible but I've only seen Apple s/w generate and play such files.
posted by Gyan at 12:08 PM on October 14

« Older Care and Feeding of Masks   |   Give me all your sandwich breads Newer »

You are not logged in, either login or create an account to post comments