『漫游』酷论坛>『影音数码技术学习交流』>[请教]mkvmerge连接视频 ..

[请教]mkvmerge连接视频有没有批处理之类的方法

whitestone@2010-04-03 01:02

有视频(mp4)
a_1, a_2, a_3
b_1, b_2
c_1, c_2, c_3, c_4, c_5
...

想把他们分别append连接成
a.mkv
b.mkv
c.mkv
...

每个视频的分段数不等,10个之内吧,有没有方便些的方法,写批处理之类的,可以简单一些操作完成拼接呢?mmg里一个一个append数目比较多,觉得比较麻烦……
引用

MeteorRain@2010-04-06 02:10

学着写脚本吧。shell脚本做起来不难
引用

roozhou@2010-04-06 09:54

事先把每组的前缀写在文件里,用个for就可以实现
至于shell,在windows上用起来不方便
引用

whitestone@2010-04-06 20:06

引用
最初由 roozhou 发布
事先把每组的前缀写在文件里,用个for就可以实现
至于shell,在windows上用起来不方便

求范例……
引用

roozhou@2010-04-06 22:25

不太熟悉mkvmerge的命令行,貌似是 a_1.mp4 +a_2.mp4这样的格式
差不多是这样的吧,%1就是那个文本文件名:

@echo off
setlocal enabledelayedexpansion
for /f %%b in (%1) do (
set aa=
for /l %%c in (2,1,9) do (
if exist %%b%%c.mp4 set aa=!aa! +%%b%%c.mp4
)
mkvmerge -o %%b.mkv %%b1.mp4!aa!
)
endlocal
引用

whitestone@2010-04-07 00:47

mkvmerge感觉就是append段数不同的话参数有些不同,主要最后那什么track order,append to那项,一串什么01122的,没太看懂那串数字是怎么定义的。比如分别连接2段,3段,4段的参数
引用

"mkvmerge" -o "F:\\1\\test.mkv" "--forced-track" "1:no" "--forced-track" "2:no" "-a" "2" "-d" "1" "-S" "-T" "--no-global-tags" "--no-chapters" "F:\\1\\test_1.mp4" "-a" "2" "-d" "1" "-S" "-T" "--no-global-tags" "--no-chapters" "+F:\\1\\test_2.mp4" "--track-order" "0:1,0:2" "--append-to" "1:1:0:1,1:2:0:2"



"mkvmerge" -o "F:\\1\\test.mkv" "--forced-track" "1:no" "--forced-track" "2:no" "-a" "2" "-d" "1" "-S" "-T" "--no-global-tags" "--no-chapters" "F:\\1\\test_1.mp4" "-a" "2" "-d" "1" "-S" "-T" "--no-global-tags" "--no-chapters" "+F:\\1\\test_2.mp4" "-a" "2" "-d" "1" "-S" "-T" "--no-global-tags" "--no-chapters" "+F:\\1\\test_3.mp4" "--track-order" "0:1,0:2" "--append-to" "1:1:0:1,2:1:1:1,1:2:0:2,2:2:1:2"



"mkvmerge" -o "F:\\1\\test.mkv" "--forced-track" "1:no" "--forced-track" "2:no" "-a" "2" "-d" "1" "-S" "-T" "--no-global-tags" "--no-chapters" "F:\\1\\test_1.mp4" "-a" "2" "-d" "1" "-S" "-T" "--no-global-tags" "--no-chapters" "+F:\\1\\test_2.mp4" "-a" "2" "-d" "1" "-S" "-T" "--no-global-tags" "--no-chapters" "+F:\\1\\test_3.mp4" "-a" "2" "-d" "1" "-S" "-T" "--no-global-tags" "--no-chapters" "+F:\\1\\test_4.mp4" "--track-order" "0:1,0:2" "--append-to" "1:1:0:1,2:1:1:1,3:1:2:1,1:2:0:2,2:2:1:2,3:2:2:2"
引用

| TOP