Created
January 21, 2014 06:31
-
-
Save arirusso/8535316 to your computer and use it in GitHub Desktop.
One-liner to get the total duration for .mov video files in the current directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Get the total duration for .mov video files in the current directory | |
# | |
find *.mov -print0 | xargs -0 /Applications/MPlayer\ OSX\ Extended.app/Contents/Resources/Binaries/mpextended.mpBinaries/Contents/mpextended.mpBinaries/Contents/MacOS/mplayer -vo dummy -ao dummy -identify 2>/dev/null | perl -nle '/ID_LENGTH=([0-9\.]+)/ && ($t +=$1) && printf "%02d:%02d:%02d\n",$t/3600,$t/60%60,$t%60' | tail -n 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment