VideoHelp Forum




+ Reply to Thread
Results 1 to 1 of 1
  1. 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:

    Code:
    @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%
    to calculate the total duration (%totalDuration%) of File1.MXF + File2.MXF + File3.MXF

    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:

    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'
    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)

    how to change the batch to do this specific operation? thanks
    Image Attached Files
    Last edited by marcorocchini; 15th Mar 2022 at 16:36.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!