Skip to content

Instantly share code, notes, and snippets.

@bwhitman
Created May 8, 2017 21:30
Show Gist options
  • Save bwhitman/5be2f905556a25145dbac74fe4080739 to your computer and use it in GitHub Desktop.
Save bwhitman/5be2f905556a25145dbac74fe4080739 to your computer and use it in GitHub Desktop.
Make an audio collage out of your live photos
mkdir /tmp/picblast; cd ~/Pictures/Photos\ Library.photoslibrary; for i in `find . | grep jpegvideocompl`;do ffmpeg -i $i /tmp/picblast/${i:(-8)}.wav; done; cd /tmp/picblast; ffmpeg -safe 0 -f concat -i <( for f in *.wav; do echo "file '$(pwd)/$f'"; done ) ~/Desktop/picblast.wav; rm -rf /tmp/picblast
@simonw
Copy link

simonw commented Sep 2, 2019

I had to install ffmpeg first:

brew install ffmpeg

Here's a version of the above script split into separate lines so you can run it one line at a time and get a better idea for how it works:

mkdir /tmp/picblast
cd ~/Pictures/Photos\ Library.photoslibrary
for i in `find . | grep jpegvideocompl`;do ffmpeg -i $i /tmp/picblast/${i:(-8)}.wav; done;
cd /tmp/picblast
ffmpeg -safe 0 -f concat -i <( for f in *.wav; do echo "file '$(pwd)/$f'"; done ) ~/Desktop/picblast.wav
rm -rf /tmp/picblast

@simonw
Copy link

simonw commented Sep 2, 2019

This can take up quite a bit of space when you run it.

I fed it 20,727 live photos which produced a 3.7GB /tmp/picblast folder, then concatenated into a 3.7GB picblast.wav file - 12 hours, 36 minutes and 38 seconds of audio!

I converted that to a 346MB .mp3 file with:

ffmpeg -i picblast.wav picblast.mp3

Then deleted picblast.wav

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