Merge branch 'main' of 47.107.44.202:xionglijia/18xchat
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 6.6 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 5.7 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 6.8 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 6.4 KiB |
@@ -1,16 +1,25 @@
|
||||
@echo off
|
||||
setlocal enabledelayedexpansion
|
||||
|
||||
:: 设置需要匹配的关键字(修改这里)
|
||||
set keyword=_thumbnail
|
||||
|
||||
:: 遍历当前目录及所有子目录
|
||||
:: 遍历 JPG 和 PNG 文件
|
||||
for /r %%i in (*.jpg *.png) do (
|
||||
set filename=%%~nxi
|
||||
set "filename=%%~nxi"
|
||||
|
||||
:: 只处理包含 _thumbnail 且不包含 _blur 的文件
|
||||
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 (
|
||||
echo !filename! | findstr /i "_blur" >nul
|
||||
if !errorlevel! neq 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
|
||||
|
||||