Skip to content

Instantly share code, notes, and snippets.

@sergiks
Last active April 10, 2019 17:18
Show Gist options
  • Save sergiks/fa03930b149f82a6dceb6f60980d3961 to your computer and use it in GitHub Desktop.
Save sergiks/fa03930b149f82a6dceb6f60980d3961 to your computer and use it in GitHub Desktop.
Compile ffmpeg and ffprobe for AWS Lambda
#!/bin/bash
############################################
#
# Compile ffmpeg and ffprobe for AWS Lambda
#
# Run this on a fresh AWS EC2 instance
# running same AMI as AWS Lambda:
# https://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html
# AMI: amzn-ami-hvm-2017.03.1.20170812-x86_64-gp2
# https://console.aws.amazon.com/ec2/v2/home#Images:visibility=public-images;search=amzn-ami-hvm-2017.03.1.20170812-x86_64-gp2
#
############################################
## Skip update as it upgrades to 2018.03 version,
## but AWS Lambda lists older 2017.03
# sudo yum update -y
sudo yum groupinstall -y "Development Tools" "Development Libraries"
git clone https://github.com/markus-perl/ffmpeg-build-script.git
cd ffmpeg-build-script/
## disable aom codec - i fails for some reason
sed -i 's/--enable-libaom/--disable-libaom/' build-ffmpeg
## Compilation takes ~90 minutes on AWS EC2 t2.micro instance
sudo nohup ./build-ffmpeg --build &
@sergiks
Copy link
Author

sergiks commented Apr 10, 2019

Main compilation script is markus-perl/ffmpeg-build-script
It only supports builds for Mac OSX 10.14 64Bit XCode 10.1 and Debian 9.4 so here I introduced a little tweak disabling libaom which was failing.

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