Skip to content

Instantly share code, notes, and snippets.

@brimston3
Created October 5, 2018 22:29
Show Gist options
  • Save brimston3/34dbb439442a723313b019b92931887b to your computer and use it in GitHub Desktop.
Save brimston3/34dbb439442a723313b019b92931887b to your computer and use it in GitHub Desktop.
bpm-tools using ffmpeg
# bpm is from debian's bpm-tools package
# ffmpeg is from the usual places
# > bpmff "Rundfunk-Tanzorchester Ehrenfeld - Daft Punk - 'Harder, Better, Faster, Stronger'-B3gG03bh7WA.mp4"
# 123.181
bpmff() {
if [ ! -f "$1" ]; then
echo "File not found"
else
ffmpeg -vn -i "$1" -ar 44100 -ac 1 -f f32le pipe:1 2>/dev/null | bpm
fi
}
@heavyimage
Copy link

heavyimage commented Sep 30, 2024

Thanks for this! I added a thanks here in my README; now my LEDs pulse in time to the music :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment