By Alvin Alexander. Last updated: January 31, 2024
If you ever need to determine the length of one or more video files (MP4 files) on a MacOS system, I can confirm that this ffmpeg
command works:
for f in `ls FINAL*mp4`; do ffmpeg -i $f 2>&1 | grep "Duration"| cut -d ' ' -f 4 | sed s/,//; done
Note that you may have to install ffmpeg
first.
When you run it from the MacOS Terminal, you will see output like this:
00:03:15.07 00:18:09.83 00:11:34.03 00:06:47.83 00:05:33.13
That output is hours, minutes, seconds, and then that last column.