我正在尝试执行这个非常有用的批处理来处理当前目录和所有子目录中的所有* .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变量&#34;%F&#34;有关。 我真的很感激一些帮助!
编辑:我删除了批处理中的所有其他内容并将其调整为
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且仍有字幕。
答案 0 :(得分:2)
AMC脚本会触发带有--def exec="path\to\filebot.bat {quote f}"
的.bat脚本吗?我认为问题是在filebot.bat
内,命令行参数应该被理解为"%~1"
,而不是%F
。
mkvmerge.exe -S "%~1" -o "%~dpn1.tmp" && >NUL move /Y "%~dpn1.tmp" "%~dpn1.mkv"
我认为应该这样做。顺便说一下,&&
取代if not errorlevel 1
。 %~dpn1
表示参数1的驱动器,路径和基本名称。