Last active
November 12, 2025 23:53
-
-
Save anarchivist/8674f4253952007b26b73147059d6029 to your computer and use it in GitHub Desktop.
get basic av info for duration calculations
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/bash | |
| # run ffprobe to gather format/duration info | |
| # returns filename,dummyfield,duration,size | |
| # print the filename first no matter what, because we want to see what's in the directories | |
| printf "$1," | |
| output=$(ffprobe -v quiet -of csv -show_entries format=format_name,duration,size "$1") | |
| retVal=$? | |
| # ffprobe returns a positive exit code if fails to parse as a multimedia file, | |
| if [ $retVal -ne 0 ]; then | |
| output="fail,,," | |
| fi | |
| printf "$output\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment