Skip to content

Instantly share code, notes, and snippets.

@flashingpumpkin
Last active February 22, 2021 16:00
Show Gist options
  • Select an option

  • Save flashingpumpkin/6240338 to your computer and use it in GitHub Desktop.

Select an option

Save flashingpumpkin/6240338 to your computer and use it in GitHub Desktop.
Save the following file in your project as `bin/post_compile` and after slug compilation it will be downloaded and a binary placed in a `vendor/ffmpeg` folder in your project root. Invoke FFMPEG as `/app/vendor/ffmpeg/ffmpeg -h`
#!/bin/bash
current=`pwd`
filename=ffmpeg.static.64bit.2013-08-15.tar.gz
url=http://ffmpeg.gusari.org/static/64bit/$filename
source $BIN_DIR/utils
puts-step "Installing FFMPEG"
# Download FFMPEG if not downladed yet
if [ ! -d $CACHE_DIR/ffmpeg ]; then
mkdir -p $CACHE_DIR/ffmpeg
cd $CACHE_DIR/ffmpeg
echo "Downloading FFMPEG ..." | indent
curl -O $url >/dev/null 2>&1
echo "Unpacking FFMPEG ..." | indent
tar -xf $filename
rm $filename
else
echo "Already downloaded FFMPEG ..." | indent
fi
echo "Installing FFMPEG ..." | indent
if [ ! -d $BUILD_DIR/vendor/ffmpeg ]; then
mkdir -p $BUILD_DIR/vendor/ffmpeg
fi
if [ ! -f $BUILD_DIR/vendor/ffmpeg/ffmpeg ]; then
cp -r $CACHE_DIR/ffmpeg/* $BUILD_DIR/vendor/ffmpeg/
fi
cd $current
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment