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

隐身守侯 提交于 2019-12-06 08:29:51

问题


From time to time I receive several mkv's from a server I have. These mkv's are all part of the same recording, but they come in 1 minute chunks, and I don't want to have to take the time to stitch them together manually each time. Can this be done via an automated process in Windows?

EDIT: See my answer below for the solution that worked for me. The post by Endoro also looks promising.


回答1:


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%



回答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.




回答3:


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



来源:https://stackoverflow.com/questions/17929948/combine-mkvs-in-windows-automated-not-using-a-gui

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