update
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,16 +1,35 @@
|
||||
@echo off
|
||||
setlocal enabledelayedexpansion
|
||||
|
||||
:: 设置需要匹配的关键字(修改这里)
|
||||
set keyword=_thumbnail
|
||||
|
||||
:: 遍历当前目录及所有子目录
|
||||
for /r %%i in (*.jpg *.png) do (
|
||||
:: 遍历 JPG
|
||||
for /r %%i in (*.jpg) do (
|
||||
set filename=%%~nxi
|
||||
echo !filename! | findstr /i "%keyword%" >nul
|
||||
if !errorlevel! == 0 (
|
||||
echo 生成模糊图: %%i
|
||||
ffmpeg -y -i "%%i" -vf "gblur=sigma=50" "%%~dpi%%~ni_blur%%~xi"
|
||||
if !errorlevel! equ 0 (
|
||||
set "blurfile=%%~dpi%%~ni_blur%%~xi"
|
||||
if not exist "!blurfile!" (
|
||||
echo 生成模糊图: %%i
|
||||
ffmpeg -y -i "%%i" -vf "gblur=sigma=50" "!blurfile!"
|
||||
) else (
|
||||
echo 已存在模糊图: !blurfile!
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
:: 遍历 PNG
|
||||
for /r %%i in (*.png) do (
|
||||
set filename=%%~nxi
|
||||
echo !filename! | findstr /i "%keyword%" >nul
|
||||
if !errorlevel! equ 0 (
|
||||
set "blurfile=%%~dpi%%~ni_blur%%~xi"
|
||||
if not exist "!blurfile!" (
|
||||
echo 生成模糊图: %%i
|
||||
ffmpeg -y -i "%%i" -vf "gblur=sigma=50" "!blurfile!"
|
||||
) else (
|
||||
echo 已存在模糊图: !blurfile!
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1
-1
Submodule xchat_cfg updated: 51d963aac1...86c51c6c06
Reference in New Issue
Block a user