我想要“读取”整个文件夹,存储所有文件名,并仅使用 cmd 为每个文件创建一个单独的 .AVS。
LE:这似乎有效(感谢grawity):
@echo off
COLOR 0c
cd > "dir.txt"
set /p mypath=<"dir.txt"
set mpath=@Temp
del "%mypath%\dir.txt"
cls
for %%i in (%mypath%\*.mkv) do call :genavs "%%~i"
goto :eof
:genavs
set movie=%~1
echo B=FFAudioSource("%movie%") >> "%movie%.avs"
echo A=FFVideoSource("%movie%").assumefps(24000,1001) >> "%movie%.avs"
echo AudioDub(A, B) >> "%movie%.avs"
echo ConvertAudioTo16bit() >> "%movie%.avs"
echo ConvertToRGB32() >> "%movie%.avs"
goto :eof
答案1
使用for
和子程序:
for %%i in (%mypath%\*.mkv) do call :genavs "%%~i"
goto :eof
:genavs
set movie=%~1
set moviedir=%~dp1
(
echo loadplugin("%moviedir%\bin\FFMS2.dll")
echo B=FFAudioSource("%movie%")
echo A=FFVideoSource("%movie%").assumefps(%myfps%)
echo AudioDub(A, B)
echo ConvertAudioTo16bit()
echo ConvertToRGB32()
) >> "%movie%.avs"
goto :eof