大问题。我就是搞不清楚我做错了什么。这是我的 .bat 文件:
@ECHO OFF
SETLOCAL
set /p Input= Drop file here, and click enter.
set file=%Input%
FOR %%i IN (%file%) DO (
ECHO filedrive=%%~di
ECHO filepath=%%~pi
ECHO filename=%%~ni
ECHO fileextension=%%~xi
ECHO %filename%
)
ffmpeg -i %Input% -an -c:v libx264 -preset medium -crf 22 "%%~di%%~pi%%~ni.mp4"
pause
当我运行这个程序时,它无法将 ffmpeg 识别为命令。这应该很简单...我到底做错了什么?
答案1
它就是这么简单:
@ECHO OFF
SETLOCAL
set /p Input= Drop file here, and click enter.
set ffmpeg=C:\Windows\User\ffmpeg.exe
set file=%Input%
FOR %%i IN (%file%) DO (
ECHO filedrive=%%~di
ECHO filepath=%%~pi
ECHO filename=%%~ni
ECHO fileextension=%%~xi
ECHO %filename%
)
%ffmpeg% -i %Input% -an -c:v libx264 -preset medium -crf 22 "%%~di%%~pi%%~ni.mp4"
pause