Joining webm videos under Linux

7

4

How can I concatenate several .webm files (e.g. downloaded from youtube) into a single file? I've tried a simple cat followed by "mencoder -forceidx -oac copy -ovc copy ..." - didn't work. I'm using Linux.

eug

Posted 2012-05-06T04:06:45.510

Reputation: 724

That's gonna be hard – most videos are not meant for concatenating. You can somewhat do this with MPEG-2 and h.264, but no idea for WebM, unless you want to re-encode them. – slhck – 2012-05-06T09:39:16.157

Answers

8

As Lou mentioned, try mkvmerge like this (from command line):

mkvmerge -o output.webm -w file1.webm + file2.webm

Laurent S

Posted 2012-05-06T04:06:45.510

Reputation: 266

2

Remember that the WebM container format is a strict subset of Matroska, so Matroska tools will work on WebM files. Try mkvmerge (which ships with mkvtoolnix) to re-mux files without re-encoding. The result may or may not be satisfactory for your purposes, but mkvtoolnix is mature and GPLv2-licensed, and well worth a try. There's even a mkvmerge GUI.

Lou Quillio

Posted 2012-05-06T04:06:45.510

Reputation: 81

Thanks for this info - I think this is definitely on the right track. I've tried the GUI but just feeding the files to it seems to be creating an output with multiple video tracks, not a single video whose length is the sum of all the inputs.. – eug – 2012-05-09T06:38:58.780

2An mkvmerge GUI operation analogous to Laurent S's CLI solution above is to Add the first file and to Append the subsequent files in the series. Might not be obvious at first. – Lou Quillio – 2012-07-09T19:46:30.433

0

If you use the mkvmerge GUI, you right-click in the "input file" section, then choose "Add Files" and select the first file from wherever you stored it.

Now, you right-click on the first file in the "input file" section and select "append files".

If, instead of choosing "append files", you chose "add files as additional parts", it won't work. This option is for combining files where the second/third/etc files don't have video headers (like if you used the Unix split command to just cut a file into chunks). If you chose that option with two WebM files, you wouldn't get any errors, but only the first video file will be present in the resulting MKV.

Chris Slycord

Posted 2012-05-06T04:06:45.510

Reputation: 1