H* ***s
please I wonder if is possible to do a batch that calculate the total duration of a variable number of video files that are in a folder
![]()
+ Reply to Thread
Results 1 to 6 of 6
-
-
Something like this:
Code:@echo off SET Mediainfo="G:\Program Files\MediainfoCLI\Mediainfo.exe" set /A total_milliseconds=0 for %%F in (*.mxf) do (call :RUNTIME1 "%%F") echo. echo Total milliseconds = %total_milliseconds% echo. pause exit 0 :RUNTIME1 set /A duration_milliseconds=0 %Mediainfo% --Inform=Video;%%Duration%% %1 > temp.tmp set /p duration_milliseconds=<temp.tmp echo %1 : %duration_milliseconds% milliseconds set /A total_milliseconds=%total_milliseconds%+%duration_milliseconds% EXIT /B
-
Here's a way to do it with ExifTool, assuming exiftool.exe is in your search path. totSecs will give you total seconds and totalDuration will give total formatted time.
Code:@echo off set /p targDir=Target directory: cd /d %targDir% set totSecs=0 for %%F in (*.*) do ( for /f "tokens=1-3 delims=: usebackq" %%X in (`exiftool -duration -s3 "%%F"`) do ( set /a "totSecs += %%X*3600 + (1%%Y %% 100)*60 + (1%%Z %% 100)" ) ) set /a hours=%totSecs%/3600 set /a mins=(%totSecs% %% 3600)/60 set /a secs=%totSecs% %% 60 set totalDuration=%hours%:%mins%:%secs%
Similar Threads
-
BATCH to generate a .avs that concatenate all files in a directory
By marcorocchini in forum Newbie / General discussionsReplies: 2Last Post: 12th Mar 2016, 15:29 -
Bulk add Credits / Intro video in each video files in a directory
By farhanisfarhan in forum EditingReplies: 7Last Post: 25th Jul 2014, 09:37 -
how can i calculate frame rate video in ulead video studio speed/duration ?
By fps in forum Video ConversionReplies: 10Last Post: 27th Nov 2013, 15:58 -
MKVmerge extends total time if subtitle duration exceeds video duration
By ankutsa in forum SubtitleReplies: 1Last Post: 7th Sep 2013, 11:08 -
bmp2avi app, how do i calculate frame duration in microseconds .. [solved]
By vhelp in forum ProgrammingReplies: 2Last Post: 22nd Mar 2013, 22:42