Hi, if you can help a cat^^
and however.
Supposing a directory in C: called AAA AAA and a subdirectory call BBB BBB, so that there is spaces in the final path:
C:\AAA AAA\BBB BBB
in BBB BBB there some .mxf video file
for example File1.MXF File2.MXF File3.MXF etc..
I like to build a batch that calculate the total duration for File1.MXF + File2.MXF + File3.MXF
the final path is:
c:\aaa aaa\bbb bbb\File1.MXF
c:\aaa aaa\bbb bbb\File2.MXF
c:\aaa aaa\bbb bbb\File3.MXF
the script (from and old post, thanks to JVRaines) seems a thing like this:
to calculate the total duration (%totalDuration%) of File1.MXF + File2.MXF + File3.MXFCode:@echo off set /p targDir=Target directory: cd /d %targDir% set totSecs=0 for %%F in (*.mxf) 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%
using the attached exiftool
but I get the error "missing operator"
is there a way to resolve this?
------------------------------------------------------
And furthermore I have a second question:
if I need to view the total duration but starting from a .txt file called concatList.txt [attached] that are formatted like this:
in this case the total duration have to be calculated adding the duration of AA011901.MXF + AA012201.MXF + AA012301.MXF + AA012401.MXF + AA012501.MXF starting from a series of .mxf file listed in a .txt file (concatList.txt)Code:file 'C:\TEST AAA\BBB BBB\AA011901.MXF' file 'C:\TEST AAA\BBB BBB\AA012201.MXF' file 'C:\TEST AAA\BBB BBB\AA012301.MXF' file 'C:\TEST AAA\BBB BBB\AA012401.MXF' file 'C:\TEST AAA\BBB BBB\AA012501.MXF'
how to change the batch to do this specific operation? thanks
+ Reply to Thread
Results 1 to 1 of 1
-
Last edited by marcorocchini; 15th Mar 2022 at 16:36.
Similar Threads
-
Batch video file analyzer - human/face detection
By simonchello in forum Newbie / General discussionsReplies: 1Last Post: 6th Oct 2021, 15:11 -
Mux audio and Video in Mkvmerge using Batch File
By Daringbaaz in forum Newbie / General discussionsReplies: 2Last Post: 18th Oct 2019, 04:30 -
Interlaced Audio Duration Longer than Video Duration (lip-sync issue)
By senlab in forum Video ConversionReplies: 7Last Post: 27th Aug 2018, 15:36 -
batch to calculate duration of all video files in a directory?
By marcorocchini in forum Newbie / General discussionsReplies: 5Last Post: 20th Jul 2017, 17:05 -
Batch replacing video file with a different audio track
By Restricted in forum Newbie / General discussionsReplies: 4Last Post: 21st Jun 2017, 06:30