回复 12# idwma
他那两段可以简化一下- @echo off
- setlocal enabledelayedexpansion
- cd /d "%~dp0"
- for /f "delims=" %%i in ('dir /b /s /a-d "*.mp4"') do (
- for /f "tokens=2,3,4 delims=:. " %%a in ('ffmpeg -i "%%i" 2^>^&1 ^| find "Duration:"') do (
- set hh=%%a
- set mm=%%b
- set ss=%%c
- )
- if "!hh:~0,1!"=="0" (set /a hh=!hh:~-1!*3600) else (set /a hh=!hh!*3600)
- if "!mm:~0,1!"=="0" (set /a mm=!mm:~-1!*60) else (set /a mm=!mm!*60)
- set /a str=!hh!+!mm!+!ss!
- set /a BianLiang=!str!/10
- set str=!BianLiang!
- for /l %%d in (1,1,9) do (
- ffmpeg -i "%%i" -ss !BianLiang! -frames:v 1 "%%~dpni0%%d.png"
- set /a BianLiang=!str!+!BianLiang!
- )
- (for /l %%x in (1,1,9) do (
- echo "%%~dpni0%%x.png"
- ))>"filelist.txt"
- "%~dp0MagickFull\magick.exe" montage @filelist.txt -geometry +0+0 -background #00000000 "%%~dpni-YuLan.jpg"
- del /q /f filelist.txt "%%~dpni0*.png"
- )
复制代码
|