Combine mkv's in Windows (automated, not using a GUI)

泪湿孤枕 提交于 2019-12-04 12:45:36

I can give you an example:

@echo off &setlocal enabledelayedexpansion
cd /d "%sourcefolder%"
set "line="
for %%a in (*.mkv) do set line=!line! +"%%~a"
mkvmerge -o "output.mkv" %line:~2%

As I continued researching, I discovered a download page that also contained a review of mkvtoolnix (http://www.fosshub.com/MKVToolNix.html) that referred to some cmd commands he tested along with the standard GUI test. using the "mkvmerge --help" command, I was able to determine the appropriate command to stitch mkv files together. It looked something like this:

C:\Program Files (x86)\MKVToolNix>mkvmerge file1.mkv + file2.mkv --output C:\Users\User1\mkvfolder\combined.mkv

This stitched two mkv files together (that were located in the MKVToolNix folder), and puts the combined.mkv file in a different directory. It seemed to me that changing the source directories for either of the original mkv's (file1.mkv, file2.mkv) should be possible as well, so I next tried this:

C:\Program Files (x86)\MKVToolNix>mkvmerge file1.mkv + C:\Users\User1\Documents\file2.mkv  --output C:\Users\User1\mkvfolder\combined.mkv

The above code merged file1.mkv (which I had placed in the mkvtoolnix directory) with file2.mkv (which I had located in a different directory), and placed the merged file (combined.mkv) in a third directory. The merged file ran cleanly in vlc, with no hiccups at the stitchpoint.

TL DR: go to http://www.fosshub.com/MKVToolNix.html, download MKVToolNix, and use the command line to merge mkv's.

You could try using AVIDemux with the --append arg. On this link there is also a batch file example script.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!