rem this assumes ffmpeg is in c:\ffmpeg
if exist filelist.txt ( del /F filelist.txt )
if exist list.txt ( del /F list.txt )
copy nul list.txt >nul
rem change exts as needed for your audio files
if exist *.mkv ( dir/b *.mkv >>list.txt )
if exist *.fl? ( dir/b *.fl? >>list.txt )
if exist *.avi ( dir/b *.avi >>list.txt )
if exist *.mp4 ( dir/b *.mp4 >>list.txt )
if exist *.mov ( dir/b *.mov >>list.txt )
if exist *.swf ( dir/b *.swf >>list.txt )
sort <list.txt >filelist.txt
for /F "delims=;" %%F in ( filelist.txt ) do (
for %%F in (^"%%F^") do (
for /f "tokens=2-5 delims=:., " %%a in (
'c:\ffmpeg\ffmpeg -i "%%F" 2^>^&1 ^| find "Duration:"'
) do (
set /a full=%%a * 60 * 60 + %%b * 60 + %%c
)
)
echo Length of %%F is %%a:%%b:%%c or !full! Seconds
)