本帖最后由 c_mang 于 2022-4-10 17:06 编辑
现有两版剧集视频文件,需采日版视频+中版双音频及字幕重新封装为MKV。
据网上教程步骤:
一:获取的单次任务处理的命令行
"C:\Program Files (x86)\MKVToolNix\mkvmerge.exe" -o "E:\\日版\\01.mkv" "--forced-track" "0:no" "-d" "0" "-A" "-S" "-T" "--no-global-tags" "--no-chapters" "(" "E:\\日版\\01.mp4" ")" "--language" "1:chi" "--track-name" "1:国语" "--default-track" "1:yes" "--forced-track" "1:no" "--language" "2:jpn" "--track-name" "2:日语" "--default-track" "2:no" "--forced-track" "2:no" "--language" "3:chi" "--track-name" "3:中字" "--default-track" "3:yes" "--forced-track" "3:no" "-a" "1,2" "-s" "3" "-D" "-T" "--no-global-tags" "--no-chapters" "(" "E:\\中版\\01.mkv" ")" "--track-order" "0:0,1:1,1:2,1:3"
二:将具体文件名变成变量。- @echo off
- set topath="E:\\日版\\"
- set frompath=""E:\\日版\\"
- set frompath1="E:\\中版\\"
- "C:\Program Files (x86)\mkvtoolnix\mkvmerge.exe" -o "%topath%01.mkv" "--forced-track" "0:no" "-d" "0" "-A" "-S" "-T" "--no-global-tags" "--no-chapters" "(" "E:\\日版\\01.mp4" ")" "--language" "1:chi" "--track-name" "1:国语" "--default-track" "1:yes" "--forced-track" "1:no" "--language" "2:jpn" "--track-name" "2:日语" "--default-track" "2:no" "--forced-track" "2:no" "--language" "3:chi" "--track-name" "3:中字" "--default-track" "3:yes" "--forced-track" "3:no" "-a" "1,2" "-s" "3" "-D" "-T" "--no-global-tags" "--no-chapters" "(" "%frompath1%01.mkv" ")" "--track-order" "0:0,1:1,1:2,1:3"
复制代码 ——粘贴到命令提示符运行成功
三:加入循环命令。- @echo off
- set topath="E:\\日版\\"
- set frompath=""E:\\日版\\"
- set frompath1="E:\\中版\\"
-
- pushd %frompath%
- for /f "tokens=*" %%i in ('dir/b *.mp4') do (call :merge %topath%%%~ni".mkv" %frompath%%%i %frompath1%%%i
- pause
-
- :merge
- "C:\Program Files (x86)\mkvtoolnix\mkvmerge.exe" -o "%1" "--forced-track" "0:no" "-d" "0" "-A" "-S" "-T" "--no-global-tags" "--no-chapters" "(" "%2" ")" "--language" "1:chi" "--track-name" "1:国语" "--default-track" "1:yes" "--forced-track" "1:no" "--language" "2:jpn" "--track-name" "2:日语" "--default-track" "2:no" "--forced-track" "2:no" "--language" "3:chi" "--track-name" "3:中字" "--default-track" "3:yes" "--forced-track" "3:no" "-a" "1,2" "-s" "3" "-D" "-T" "--no-global-tags" "--no-chapters" "(" "%3" ")" "--track-order" "0:0,1:1,1:2,1:3"
- )
复制代码 ——报错:
pushd %frompath%
for /f "tokens=*" %%i in ('dir/b *.mp4') do (call :merge %topath%%%~ni".mkv" %frompath%%%i %frompath1%%%i
此时不应有 %%i。
期待高手指点,谢谢! |