5

I have multiple mkv files in a ubuntu directory.I have installed 'avconv' tool and its working fine. My aim is to simple concatenate all those files and produce a single mkv file. I referenced so many articles and found that this command should serve the purpose:

avconv -i "concat:1-1.mkv|1-2.mkv|1-3.mkv" -c copy 1.mkv

However, when I run it, I get error:

concat:1-1.mkv|1-2.mkv|1-3.mkv: No such file or directory

I even tried it with mp4 files but still the same error.

Can anyone point out what wrong I am doing ? Or there is any other approach ?

llogan
  • 87,794
  • 21
  • 166
  • 190
Danny
  • 153
  • 3
  • 13

1 Answers1

5

ffmpeg may turn out to be a better alternative. There is an entire wiki-page about concatenation of media files with ffmpeg.

Alternatively, try the mkvmerge utility:

mkvmerge -o 1.mkv 1-1.mkv + 1-2.mkv + 1-3.mkv

Community
  • 1
  • 1
Leon
  • 28,052
  • 3
  • 52
  • 82
  • Thanks, mkvmerge does the job perfectly ! – Danny Jun 07 '16 at 10:06
  • 1
    In case you have a directory of files you want to merge, something like `mkvmerge -o ../merged.mkv $(ls -1 | paste -sd" " | sed 's/ / + /g')` may come in handy (assuming the filenames do not contain spaces). – Hermann Mar 05 '21 at 21:40