【发布时间】:2017-07-23 16:17:49
【问题描述】:
我正在尝试执行这个非常有用的批处理来处理当前目录和所有子目录中的所有 *.avi、*.mkv 和 *.mp4 文件并生成 *.mkv 文件(在过程中删除字幕)并删除原始文件文件
@echo off
for /F "delims=" %%I in ('dir /A-D /B /ON /S *.avi *.mkv *.mp4 2^>nul') do (
mkvmerge.exe "%%~I" -o "%%~dpI~%%~nI.tmp" --no-subtitles
if not errorlevel 1 (
del "%%~I"
move /Y "%%~dpI~%%~nI.tmp" "%%~dpnI.mkv" >nul
)
)
使用 Filebots AMC 脚本 (qBittorrent)
filebot -script fn:amc --output "/path/to/media" --action duplicate --conflict skip -non-strict --log-file amc.log --def excludeList=amc.excludes unsorted=y music=y artwork=y "ut_dir=%F" "ut_kind=multi" "ut_title=%N" "ut_label=%L"
--def exec="mkvpropedit {quote f} --edit info --set title={quote object}"
所以我尝试将批处理调整为 qBittorrents 变量并将其命名为 filebot.bat:
mkvmerge.exe "%F" -o "%F.tmp" --no-subtitles
if not errorlevel 1 (
del "%F"
move /Y "%F.tmp" "%F.mkv" >nul
)
并相应调整了 AMC 脚本
filebot -script fn:amc --output "D:\Desktop\filebot\test2" --action duplicate --conflict skip -non-strict --log-file amc.log --def excludeList=amc.excludes unsorted=n music=y artwork=n "ut_dir=D:\Desktop\filebot\test1\test.avi" "ut_kind=multi" --def exec="D:\Desktop\filebot\test3\filebot.bat {quote f}"
AMC 正常工作,但是当 --def exec 命令被触发时,会发生这种情况:
C:\Users\Admin>mkvmerge.exe "F.tmp" --no-subtitles
mkvmerge v13.0.0 ('The Juggler') 64bit
Error: no destination file name was given.
mkvmerge -o out [global options] [options1] <file1> [@option-file.json] …
我猜这与 qBittorrent 变量“%F”有关。 我真的很感激一些帮助!
编辑:我删除了批处理中的所有其他内容并将其调整为
mkvmerge.exe "%~1" -o "%~dpn1.tmp" --no-subtitles && >NUL move /Y "%~dpn1.tmp" "%~n1.mkv"
这是 cmd 在 AMC 已经正常工作后所说的:
C:\Users\Admin>mkvmerge.exe "D:\Desktop\filebot\test2\TV Shows\StartUp (2016)\Season 01\StartUp (2016) - S01E01 - Seed Money.avi" -o "D:\Desktop\filebot\test2\TV Shows\StartUp (2016)\Season 01\StartUp (2016) - S01E01 - Seed Money.tmp" --no-subtitles && move /Y "D:\Desktop\filebot\test2\TV Shows\StartUp (2016)\Season 01\StartUp (2016) - S01E01 - Seed Money.tmp" "StartUp (2016) - S01E01 - Seed Money.mkv" 1>NUL
mkvmerge v13.0.0 ('The Juggler') 64bit
'D:\Desktop\filebot\test2\TV Shows\StartUp (2016)\Season 01\StartUp (2016) - S01E01 - Seed Money.avi': Using the demultiplexer for the format 'Matroska'.
'D:\Desktop\filebot\test2\TV Shows\StartUp (2016)\Season 01\StartUp (2016) - S01E01 - Seed Money.avi' track 0: Using the output module for the format 'AVC/h.264'.
'D:\Desktop\filebot\test2\TV Shows\StartUp (2016)\Season 01\StartUp (2016) - S01E01 - Seed Money.avi' track 1: Using the output module for the format 'AAC'.
'D:\Desktop\filebot\test2\TV Shows\StartUp (2016)\Season 01\StartUp (2016) - S01E01 - Seed Money.avi' track 2: Using the output module for the format 'text subtitles'.
'D:\Desktop\filebot\test2\TV Shows\StartUp (2016)\Season 01\StartUp (2016) - S01E01 - Seed Money.avi' track 3: Using the output module for the format 'text subtitles'.
The file 'D:\Desktop\filebot\test2\TV Shows\StartUp (2016)\Season 01\StartUp (2016) - S01E01 - Seed Money.tmp' has been opened for writing.
Progress: 100%
The cue entries (the index) are being written...
Multiplexing took 6 seconds.
Done ?(?????)?
该文件仍然是 .avi,并且仍然有字幕。
【问题讨论】:
标签: batch-file command-line cmd mkv