Ticket #465: mp3length.sh
| File mp3length.sh, 490 bytes (added by , 20 years ago) |
|---|
| Line | |
|---|---|
| 1 | #!/bin/sh |
| 2 | |
| 3 | # this script reports data about CBR/VBR MP3s |
| 4 | # 1/2007, aaron@lithic.org |
| 5 | |
| 6 | |
| 7 | while [ $# -gt 0 ]; |
| 8 | do |
| 9 | time=`nice mplayer -vc null -vo null -ao pcm:fast:file=/dev/null "$1" 2>&1 | tr '\r' '\n' | grep ^A: | tail -n 1 | sed 's/A: *[0-9.]* (\([0-9:.^ ]*\).*/\1/'` |
| 10 | size=`du -b "$1" | sed 's/\([0-9]*\).*/\1/'` |
| 11 | total=`bc -l <<< ${time//:/*60+}` |
| 12 | kbps=`bc -l <<< "scale=2; ($size*8)/($total*1000)"`; |
| 13 | |
| 14 | echo -e "$time at $kbps Kbps\t$1"; |
| 15 | shift; |
| 16 | done |
| 17 |
