我有一个名为ffprobe.log的文件,其中包含以下文字:
ffprobe version N-63113-g72dcd48 Copyright (c) 2007-2014 the FFmpeg developers
Duration: 00:00:35.37, start: 0.000000, bitrate: 60268 kb/s
我应该做这个操作:
1)从符号HH:MM:SS:milli hous:min:second:millisec
开始计算持续时间的值2)将整个值乘以25(视频pal模式),例如在这种情况下为35.37(秒)x 25(帧)== 884,25
3)向下舍入= 884
4)将值884放入变量%number_Of_Frames_at_25fps%
我可以这样做吗?非常感谢!(注意:frame0 + frame1 + frame2 + ...... + frame24 == 1秒)
答案 0 :(得分:0)
对this进行了一些更改,但具有相同的想法
@echo off
setlocal enableextensions disabledelayedexpansion
set "frameRate=25"
for /f "tokens=2" %%a in ('
type ffprobe.log ^| findstr /b /c:"Duration:"
') do set "timecode=%%a"
set "timecode=:%timecode:.=:%"
for /f "tokens=1-4 delims=:," %%a in (
"%timecode::0=: %"
) do set /a "number_Of_Frames_at_%frameRate%fps=((%%a00)*3600 + (%%b00)*60 + (%%c00) + (%%d0)/10 ) * %frameRate% / 100"
echo %number_Of_Frames_at_25fps%