Skip to content

Instantly share code, notes, and snippets.

@binoculars
Created February 15, 2016 20:18
Show Gist options
  • Save binoculars/1b064a6681c19a4eef10 to your computer and use it in GitHub Desktop.
Save binoculars/1b064a6681c19a4eef10 to your computer and use it in GitHub Desktop.
aws-lambda-ffmpeg installation
➜ ~ git clone https://github.com/binoculars/aws-lambda-ffmpeg.git
Cloning into 'aws-lambda-ffmpeg'...
remote: Counting objects: 137, done.
remote: Total 137 (delta 0), reused 0 (delta 0), pack-reused 137
Receiving objects: 100% (137/137), 179.76 KiB | 0 bytes/s, done.
Resolving deltas: 100% (76/76), done.
Checking connectivity... done.
➜ ~ cd aws-lambda-ffmpeg
➜ aws-lambda-ffmpeg git:(master) npm i
npm WARN deprecated [email protected]: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.
/
> [email protected] postinstall /Users/barrett/aws-lambda-ffmpeg
> gulp postinstall
[14:10:07] Using gulpfile ~/aws-lambda-ffmpeg/gulpfile.js
[14:10:07] Starting 'postinstall'...
[14:10:07] Finished 'postinstall' after 5.58 ms
[email protected] node_modules/gulp-rename
[email protected] node_modules/async
[email protected] node_modules/run-sequence
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
[email protected] node_modules/gulp-zip
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected])
[email protected] node_modules/gulp-flatten
└── [email protected] ([email protected], [email protected])
[email protected] node_modules/del
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected])
└── [email protected] ([email protected], [email protected], [email protected])
[email protected] node_modules/gulp-util
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected])
└── [email protected] ([email protected], [email protected])
[email protected] node_modules/gulp
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
[email protected] node_modules/gulp-install
├── [email protected] ([email protected], [email protected])
└── [email protected] ([email protected], [email protected])
[email protected] node_modules/gulp-shell
├── [email protected] ([email protected], [email protected])
└── [email protected]
[email protected] node_modules/aws-sdk
├── [email protected]
├── [email protected]
└── [email protected]
➜ aws-lambda-ffmpeg git:(master) nano config.json
➜ aws-lambda-ffmpeg git:(master) cat config.json
{
"videoMaxWidth": 320,
"videoMaxDuration": 60,
"functionBucket": "function-bucket-a1b2",
"sourceBucket": "src-bucket-a1b2xzcb7431",
"destinationBucket": "dst-bucket-a1b2xzcb7431",
"linkPrefix": "http://my.site/",
"gzip": false,
"format": {
"image": {
"extension": "png",
"mimeType": "image/png"
},
"video": {
"extension": "mp4",
"mimeType": "video/mp4"
}
}
}
➜ aws-lambda-ffmpeg git:(master) aws s3api create-bucket --bucket function-bucket-a1b2
{
"Location": "/function-bucket-a1b2"
}
➜ aws-lambda-ffmpeg git:(master) export AWS_REGION=us-east-1
➜ aws-lambda-ffmpeg git:(master) gulp
[14:14:29] Using gulpfile ~/aws-lambda-ffmpeg/gulpfile.js
[14:14:29] Starting 'default'...
[14:14:29] Starting 'build-upload'...
[14:14:29] Starting 'clean'...
[14:14:29] Finished 'clean' after 28 ms
[14:14:29] Starting 'download-ffmpeg'...
[14:14:32] Finished 'download-ffmpeg' after 3.22 s
[14:14:32] Starting 'untar-ffmpeg'...
x ffmpeg-git-20160215-64bit-static/
x ffmpeg-git-20160215-64bit-static/ffserver
x ffmpeg-git-20160215-64bit-static/GPLv3.txt
x ffmpeg-git-20160215-64bit-static/ffmpeg-10bit
x ffmpeg-git-20160215-64bit-static/manpages/
x ffmpeg-git-20160215-64bit-static/manpages/ffmpeg-all.txt
x ffmpeg-git-20160215-64bit-static/manpages/ffserver.txt
x ffmpeg-git-20160215-64bit-static/manpages/ffmpeg-bitstream-filters.pdf
x ffmpeg-git-20160215-64bit-static/manpages/ffmpeg-scaler.txt
x ffmpeg-git-20160215-64bit-static/manpages/ffmpeg-resampler.txt
x ffmpeg-git-20160215-64bit-static/manpages/ffmpeg-devices.pdf
x ffmpeg-git-20160215-64bit-static/manpages/ffmpeg-filters.txt
x ffmpeg-git-20160215-64bit-static/manpages/ffmpeg-protocols.pdf
x ffmpeg-git-20160215-64bit-static/manpages/ffmpeg-scaler.pdf
x ffmpeg-git-20160215-64bit-static/manpages/ffprobe.txt
x ffmpeg-git-20160215-64bit-static/manpages/ffmpeg-devices.txt
x ffmpeg-git-20160215-64bit-static/manpages/ffmpeg.pdf
x ffmpeg-git-20160215-64bit-static/manpages/ffmpeg-formats.pdf
x ffmpeg-git-20160215-64bit-static/manpages/ffmpeg-codecs.pdf
x ffmpeg-git-20160215-64bit-static/manpages/ffmpeg-utils.txt
x ffmpeg-git-20160215-64bit-static/manpages/ffmpeg-resampler.pdf
x ffmpeg-git-20160215-64bit-static/manpages/ffprobe.pdf
x ffmpeg-git-20160215-64bit-static/manpages/ffmpeg-utils.pdf
x ffmpeg-git-20160215-64bit-static/manpages/ffmpeg-protocols.txt
x ffmpeg-git-20160215-64bit-static/manpages/ffmpeg-codecs.txt
x ffmpeg-git-20160215-64bit-static/manpages/ffserver.pdf
x ffmpeg-git-20160215-64bit-static/manpages/ffmpeg-filters.pdf
x ffmpeg-git-20160215-64bit-static/manpages/ffmpeg-bitstream-filters.txt
x ffmpeg-git-20160215-64bit-static/manpages/ffmpeg-all.pdf
x ffmpeg-git-20160215-64bit-static/manpages/ffmpeg.txt
x ffmpeg-git-20160215-64bit-static/manpages/ffmpeg-formats.txt
x ffmpeg-git-20160215-64bit-static/ffprobe
x ffmpeg-git-20160215-64bit-static/qt-faststart
x ffmpeg-git-20160215-64bit-static/readme.txt
x ffmpeg-git-20160215-64bit-static/ffmpeg
[14:14:34] Finished 'untar-ffmpeg' after 1.46 s
[14:14:34] Starting 'copy-ffmpeg'...
[14:14:34] Starting 'js'...
[14:14:34] Starting 'npm'...
[14:14:34] Finished 'js' after 13 ms
[14:14:34] Finished 'copy-ffmpeg' after 158 ms
/
> [email protected] postinstall /Users/barrett/aws-lambda-ffmpeg/dist
> gulp postinstall
[14:14:35] Working directory changed to ~/aws-lambda-ffmpeg
[14:14:35] Using gulpfile ~/aws-lambda-ffmpeg/gulpfile.js
[14:14:35] Starting 'postinstall'...
[14:14:35] Finished 'postinstall' after 716 μs
[email protected] node_modules/async
[14:14:35] Finished 'npm' after 1.27 s
[14:14:35] Starting 'zip'...
[14:14:37] Finished 'zip' after 2.27 s
[14:14:37] Starting 'upload'...
[14:15:02] Finished 'upload' after 24 s
[14:15:02] Finished 'build-upload' after 33 s
[14:15:02] Starting 'deployStack'...
[14:15:03] Finished 'deployStack' after 936 ms
[14:15:03] Finished 'default' after 34 s
➜ aws-lambda-ffmpeg git:(master) curl http://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_5mb.mp4 -o video.mp4
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 5130k 100 5130k 0 0 734k 0 0:00:06 0:00:06 --:--:-- 1200k
➜ aws-lambda-ffmpeg git:(master) ✗ aws s3 cp ./video.mp4 s3://src-bucket-a1b2xzcb7431/
upload: ./video.mp4 to s3://src-bucket-a1b2xzcb7431/video.mp4
➜ aws-lambda-ffmpeg git:(master) ✗ aws s3 ls s3://dst-bucket-a1b2xzcb7431/
2016-02-15 15:00:05 2030246 video.mp4
2016-02-15 15:00:05 141595 video.png
➜ aws-lambda-ffmpeg git:(master) ✗
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment