This commit is contained in:
2025-09-01 18:43:15 +08:00
parent 2db07f19a8
commit e2e542f6f1
15 changed files with 40 additions and 16 deletions
@@ -12,17 +12,22 @@ for /r %%i in (*.mp4) do (
REM 生成输出文件名(与视频文件同名,不同扩展名)
set "output_file=%%~ni_thumbnail.jpg"
REM 提取第一帧
echo 正在处理: %%~nxi
ffmpeg -i "%%i" -vframes 1 -q:v 4 "!file_path!!output_file!" -y 2>nul
if !errorlevel! equ 0 (
echo 成功: !output_file!
REM 判断目标文件是否存在
if not exist "!file_path!!output_file!" (
REM 提取第一帧
echo 正在处理: %%~nxi
ffmpeg -i "%%i" -vframes 1 -q:v 4 "!file_path!!output_file!" -y 2>nul
if !errorlevel! equ 0 (
echo 成功: !output_file!
) else (
echo 失败: %%~nxi
)
echo.
) else (
echo 失败: %%~nxi
echo 已存在截图: !output_file!, 跳过生成.
)
echo.
)
echo 所有视频处理完成!
pause
pause