Code Monkey home page Code Monkey logo

aws-lambda-ffmpeg's Introduction

⚠️ This repository is now archived. Please see the Quipt mediaHandler for a current implementation. ⚠️

An AWS Lambda function that resizes videos and outputs thumbnails using FFmpeg. This function is meant for short-duration videos. If you need to transcode long videos, check out AWS Elastic Transcoder.

Dependency Status devDependency Status Known Vulnerabilities

  • Master: Build Status

Function Process Overview

  1. A video file is uploaded to the source storage location
  2. A notification event triggers the function
  3. The function downloads the video file from the source location
  4. Streams the video through FFmpeg
  5. Outputs a scaled video file and a thumbnail image
  6. Uploads both files to the destination bucket

Setup

  1. Install node.js, preferably through nvm. Each platform service uses a specific version of Node.js.
  2. Clone this repo git clone ...
  3. Run npm install
  4. Create your function code's storage location (or choose an existing one)
  5. Update the platform-specific configuration JSON file (see below), and/or modify the code file for your purposes
  6. Run Gulp (see below)
  7. Invoke the function by uploading a video to your source storage location.

Configuration

See config_samples.

At minimum, you need to modify:

  • functionBucket - The name of the bucket where your the lambda function code will be uploaded to. It's necessary for CloudFormation.
  • sourceBucket - The name of the bucket that will receive the videos and send them to the lambda for processing.
  • destinationBucket - The name of the bucket that will be used to store the output video and thumbnail image.

Local Testing

Unit Tests

  • Run npm test

Integration Tests

  • Install FFmpeg locally or use the compilation guide
  • Edit event/{platform}.json and run node test/{platform}.js, where platform is (aws|msa|gcp)
  • When switching among the platforms, reinstall the node modules if the runtime supports a different version of Node.js.
  • See the platform-specific notes

Platform-specific notes

AWS Lambda

  • Version information
  • Pick the largest memory allocation. This is mostly CPU bound, but Lambda bundles memory and CPU allocation together. Memory size is 1536 by default, in the CloudFormation template. Testing with different videos and sizes should give you a good idea if it meets your requirements. Total execution time is limited!
  • The object key from the event is URL encoded. Spaces in the filenames might be replaced with + so be aware of this and handle errors appropriately. If you try to download the file with the AWS SDK for JavaScript like in this example, without handling this, it will throw an error.
  • Not handling errors with context.fail(error) will cause the function to run until the timeout is reached.

Example local testing script

# Environment variables
export AWS_ACCESS_KEY_ID=AKIDEXAMPLE
export AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY
export AWS_REGION=us-east-1
# Note that the following variable is single-quote escaped. Use $KEY_PREFIX to get the filename minus the extension.
export FFMPEG_ARGS=$'-c:a copy -vf scale=\'min(320\\,iw):-2\' -movflags +faststart -metadata description=http://my.site/$KEY_PREFIX.mp4 out.mp4 -vf thumbnail -vf scale=\'min(320\\,iw):-2\' -vframes 1 out.png'
export MIME_TYPES='{"png":"image/png","mp4":"video/mp4"}'
export VIDEO_MAX_DURATION='30'
# Node version
nvm use 14 # This is subject to change
# Babel-node test script
node node_modules/babel-cli/bin/babel-node.js test/aws.js

Gulp

Task: aws:create-cfn-bucket

Creates the CloudFormation for your CloudFormation template and Lambda function code. Run this once. Set the CFN_S3_BUCKET environment variable to the name of the bucket you want to create.

CFN_S3_BUCKET=cloudformation-bucket gulp aws:create-cfn-bucket

Environment Settings

The following environment variables must be set prior to using the rest of the gulp commands

export CFN_S3_BUCKET=cloudformation-bucket
export SOURCE_BUCKET=source-bucket
export DESTINATION_BUCKET=destination-bucket
# Note that the following variable is single-quote escaped. Use $KEY_PREFIX to get the filename minus the extension.
export FFMPEG_ARGS=$'-c:a copy -vf scale=\'min(320\\,iw):-2\' -movflags +faststart -metadata description=http://my.site/$KEY_PREFIX.mp4 out.mp4 -vf thumbnail -vf scale=\'min(320\\,iw):-2\' -vframes 1 out.png'
export MIME_TYPES='{"png":"image/png","mp4":"video/mp4"}' # must be a JSON object with "extension": "mimeType" as the key/value pairs
export VIDEO_MAX_DURATION='30' # must be a number

Task: aws:default

Everything you need to get started. Note: You can change the stack name by setting environment variable STACK_NAME.

  • Runs the aws:build-upload task
  • Runs the aws:deployStack task

Task: aws:build-upload

  • Builds dist.zip
    • Downloads and extracts FFmpeg binaries
    • Transpiles, installs dependencies, and copies configuration
  • Uploads dist.zip to the function's S3 bucket

Task: aws:deployStack

  • Creates or updates the CloudFormation stack which includes:
    • The lambda function's execution role and policy
    • The lambda function
    • The source bucket (where videos are uploaded to), including the notification configuration
    • The destination bucket (where videos and thumbnails go after they are processed)

Task: aws:update

Run after modifying anything in the function or configuration, if you've already created the stack. This will rebuild dist.zip, upload it to S3, and update the lambda function created during the CloudFormation stack creation.

Google Cloud Functions

See the quickstart guide.

Gulp

Note: you must have the gcloud CLI tool installed.

Task: gcp:default

  • Builds everything into the build/ directory
  • Deploys the function. Note: GCF does the npm install on the server-side, so there is no need to build a zip file.

Example local testing script

# Environment variables
export GCLOUD_PROJECT=example-project-name
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/credentials.json
export CONFIG_FILE=../config/gcp.json
# Node version
nvm use 6.9.1 # This is subject to change
# Babel-node test script
node node_modules/babel-cli/bin/babel-node.js --presets es2015 test/gcp.js

IBM OpenWhisk (not started, HELP WANTED)

See the OpenWhisk repo

Microsoft Azure Functions (in progress, HELP WANTED)

See Azure functions reference.

Example local testing script

# Environment variables
export AZURE_STORAGE_CONNECTION_STRING=... # copy from azure console
export CONFIG_FILE=../config/msa.json
# Node version
nvm use 5.9.1 # This is subject to change
# Babel-node test script
node node_modules/babel-cli/bin/babel-node.js --presets es2015-node5 test/aws.js

Contributing

Submit issues if you find bugs or something is unclear. Pull requests are even better, especially if you can make something more generalized.

If you use it, ⭐ it!

aws-lambda-ffmpeg's People

Contributors

binoculars avatar dependabot[bot] avatar digitalkaoz avatar greenkeeper[bot] avatar stiig avatar tashian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aws-lambda-ffmpeg's Issues

Run thumbnail only job

Is it possible to run a thumbnail only job that outputs an image? I would like to run this command ffmpeg -i file.mp4 -filter_complex "select='isnan(prev_selected_t)+gte(t-prev_selected_t\,1)',yadif,scale=240:-1, crop=240:135, tile=1x50" -vframes 1 -t 30 -q:v 4 scrub.jpg.

I have tried to to use the ffmpeg args like this export FFMPEG_ARGS=$'-c:a copy -filter_complex "select=\'isnan(prev_selected_t)+gte(t-prev_selected_t\,1)\',yadif,scale=240:-1, crop=240:135, tile=1x50" -vframes 1 scrub.jpg' but with no luck. I don't get any output at all?

Error on task aws:create-cfn-bucket: Missing required key \'Bucket\' in params

It's probably a silly mistake on my side, but I'm not able to proceed with setup, being stuck at gulp aws:create-cfn-bucket. The command immediately fails with the following message:

[13:02:20] Using gulpfile ~/Projects/aws-lambda-ffmpeg/gulpfile.js
[13:02:20] Starting 'aws:create-cfn-bucket'...
{ MissingRequiredParameter: Missing required key 'Bucket' in params
    at ParamValidator.fail (/Users/victor/Projects/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/param_validator.js:50:37)
    at ParamValidator.validateStructure (/Users/victor/Projects/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/param_validator.js:61:14)
    at ParamValidator.validateMember (/Users/victor/Projects/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/param_validator.js:88:21)
    at ParamValidator.validate (/Users/victor/Projects/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/param_validator.js:34:10)
    at Request.VALIDATE_PARAMETERS (/Users/victor/Projects/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/event_listeners.js:108:42)
    at Request.callListeners (/Users/victor/Projects/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/sequential_executor.js:105:20)
    at callNextListener (/Users/victor/Projects/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/sequential_executor.js:95:12)
    at /Users/victor/Projects/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/event_listeners.js:74:9
    at finish (/Users/victor/Projects/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/config.js:308:7)
    at /Users/victor/Projects/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/config.js:324:9
  message: 'Missing required key \'Bucket\' in params',
  code: 'MissingRequiredParameter',
  time: 2017-04-03T16:02:20.871Z }

I noticed that this project is no longer supposed to read settings from a JSON file for AWS deployments, so I tried exporting the bucket names as environment variables, but still got the same error. AWS cli and credentials are correctly configured. Any directions on how to proceed?

question: are long/complex ffmpeg process supported?

Hi guys, some AWS/Lambda functionalities are really vague to me, reaching out for help.

What are the limits of execution time of FFmpeg on Lambda? If I would like to overlay 2 videos together which requires transcoding, will aws-lambda-ffmpeg support such operation? Will Lambda prevent the long ffmpeg task from running?

I've looked over at Elastic Transcoder and other services like Zencoder and encoding.com. Lots of the functionalities we're using are missing (such as FFmpeg filters and more)... I'm planning to build my own little service and thought Lambda and this package may help but I'm not certain about performance or if it's possible at all.

Cheers

Errors on aws:upload

Hi, no doubt this is an oversight on my part, but this errors due to RequestTimeout, at the aws:upload stage.

Inline Coding on Lambda and Documentation

Hi,

I am editing my code inline on Lambda. Is there a way I can also include and use this library with that method?

Alternatively, if that is not possible and I have to upload a zip file to Lambda, could you please expand your documentation to include code samples? Unless I have missed something, there is no place where you describe using code examples how to use your library to for example convert mp4 from s3 to mp3, which you would send back to s3.

Looking forward to your reply, thanks.

lodash._rescope dependancy

Hi, while trying to get gulp aws:create-cfn-bucket running, I bump into an error:

module.exports = (arr, ...values) => {
                       ^^^

SyntaxError: Unexpected token ...

just installed everything on a clean MacOsX Sierra, any suggestions?

[Documentation] Having trouble understanding how to set it up on AWS

Hello,

Sorry if that seems basic, but I didn't really understand everything on the process to install the function in AWS Lambda.

  1. Step 4. Create your function code's storage location (or choose an existing one) : does that mean creating the Lambda function distantly ? (seems unlikely since it's the purpose of this repo)
    Or put it in a local file (if so, where) ?
  2. Step 5. I didn't understand why on config_samples/ samples there is no file for AWS ?

Thanks for your great work :)

Uploading a minute mp4 file fails to transcode

Hi,

When i upload a short video the lambda transcode the input right away and everything seems to be working fine. but when i try to upload a one minute video it fails to transcode (the file size is 7Mb).
is there a reason it is happening?

ron

'untar-ffmpeg' fails with "Unrecognized archive format"

I recently upgraded to Mac OSx Version 10.11.6, and now when I try and run

gulp aws:default

I get the following error log:

[15:51:25] Using gulpfile ~/XXXXXXXXXX
[15:51:25] Starting 'aws:default'...
[15:51:25] Starting 'aws:build-upload'...
[15:51:25] Starting 'clean'...
[15:51:26] Finished 'clean' after 13 ms
[15:51:26] Starting 'download-ffmpeg'...
[15:51:26] Starting 'aws:transpile'...
[15:51:26] Starting 'aws:config'...
[15:51:26] Starting 'npm'...
[15:51:26] Finished 'aws:config' after 247 ms
[15:51:26] Finished 'download-ffmpeg' after 268 ms
[15:51:26] Finished 'aws:transpile' after 267 ms
[15:51:26] Starting 'aws:source'...
[15:51:26] Finished 'aws:source' after 2.35 μs
[15:51:26] Finished 'npm' after 687 ms
[15:51:26] Starting 'untar-ffmpeg'...
tar: Unrecognized archive format
tar: Error exit delayed from previous errors.
[15:51:26] 'untar-ffmpeg' errored after 10 ms
[15:51:26] Error: Command tar -xvf build/ffmpeg-git-64bit-static.tar.xz -C ./build failed with exit code 1
at ChildProcess.exithandler (child_process.js:202:12)
at emitTwo (events.js:100:13)
at ChildProcess.emit (events.js:185:7)
at maybeClose (internal/child_process.js:827:16)
at Socket. (internal/child_process.js:319:11)
at emitOne (events.js:90:13)
at Socket.emit (events.js:182:7)
at Pipe._onclose (net.js:475:12)
[15:51:26] 'aws:default' errored after 730 ms
[15:51:26] Error in plugin 'run-sequence(untar-ffmpeg)'
Message:
Command tar -xvf build/ffmpeg-git-64bit-static.tar.xz -C ./build failed with exit code 1
Details:
killed: false
code: 1
signal: null
cmd: tar -xvf build/ffmpeg-git-64bit-static.tar.xz -C ./build
stdout:
stderr: tar: Unrecognized archive format
tar: Error exit delayed from previous errors.

Stack:
Error: Command tar -xvf build/ffmpeg-git-64bit-static.tar.xz -C ./build failed with exit code 1
at ChildProcess.exithandler (child_process.js:202:12)
at emitTwo (events.js:100:13)
at ChildProcess.emit (events.js:185:7)
at maybeClose (internal/child_process.js:827:16)
at Socket. (internal/child_process.js:319:11)
at emitOne (events.js:90:13)
at Socket.emit (events.js:182:7)
at Pipe._onclose (net.js:475:12)
[15:51:26] 'aws:build-upload' errored after 731 ms
[15:51:26] Error in plugin 'run-sequence(aws:default)'
Message:
Command tar -xvf build/ffmpeg-git-64bit-static.tar.xz -C ./build failed with exit code 1
Details:
killed: false
code: 1
signal: null
cmd: tar -xvf build/ffmpeg-git-64bit-static.tar.xz -C ./build
stdout:
stderr: tar: Unrecognized archive format
tar: Error exit delayed from previous errors.

Stack:
Error: Command tar -xvf build/ffmpeg-git-64bit-static.tar.xz -C ./build failed with exit code 1
at ChildProcess.exithandler (child_process.js:202:12)
at emitTwo (events.js:100:13)
at ChildProcess.emit (events.js:185:7)
at maybeClose (internal/child_process.js:827:16)
at Socket. (internal/child_process.js:319:11)
at emitOne (events.js:90:13)
at Socket.emit (events.js:182:7)
at Pipe._onclose (net.js:475:12)
[15:51:26] 'aws:build-upload' errored after 731 ms
[15:51:26] Error in plugin 'run-sequence(untar-ffmpeg)'
Message:
Command tar -xvf build/ffmpeg-git-64bit-static.tar.xz -C ./build failed with exit code 1
Details:
killed: false
code: 1
signal: null
cmd: tar -xvf build/ffmpeg-git-64bit-static.tar.xz -C ./build
stdout:
stderr: tar: Unrecognized archive format
tar: Error exit delayed from previous errors.

Stack:
Error: Command tar -xvf build/ffmpeg-git-64bit-static.tar.xz -C ./build failed with exit code 1
at ChildProcess.exithandler (child_process.js:202:12)
at emitTwo (events.js:100:13)
at ChildProcess.emit (events.js:185:7)
at maybeClose (internal/child_process.js:827:16)
at Socket. (internal/child_process.js:319:11)
at emitOne (events.js:90:13)
at Socket.emit (events.js:182:7)
at Pipe._onclose (net.js:475:12)

It appears that the file that is getting downloaded from https://www.johnvansickle.com/ffmpeg/ is somehow getting corrupted.

Any ideas on how to debug?

Unable to import module 'aws/index'

Hi Barrett,

I get this error after uploading the test video (good.mp4), after the setup procedure completed correctly.

Unable to import module 'aws/index': Error at Function.Module._resolveFilename (module.js:325:15) at Function.Module._load (module.js:276:25) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at Object.<anonymous> (/var/task/common.js:18:12) at Module._compile (module.js:409:26) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Module.require (module.js:353:17)

For this error, I found that in some cases the zip structure is not correct, but all looks good. This is the structure:

aws - dir
- index.js - 956
- lib.js - 2,231
common.js - 7,986
config.json - 394
ffmpeg - 45,431,664
ffprobe - 45,345,328
node_modules - dir (empty)

This is the link to the package: https://s3.eu-central-1.amazonaws.com/amc-functions/aws-lambda-ffmpeg.zip

I appreciate your work
Gabriel

error while running the package on trigger

Unable to import module 'index': Error
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)

I am deploying the created zip to aws lambda function and when i am triggering it , then i am getting this error.

I am a complete new bie..
Just trying to run the code.

Error when running task aws:deployStack

I'm able to run gulp aws:create-cfn-bucket and gulp aws:build-upload succesfully, but when I run gulp aws:deployStack, I get the error:

TypeError: Cannot read property 'Symbol(Symbol.iterator)' of undefined
at Parameters.map (/root/aws-lambda-ffmpeg/platform/aws/gulpfile.js:134:9)
at Array.map (native)
at Gulp.gulp.task (/root/aws-lambda-ffmpeg/platform/aws/gulpfile.js:134:5)
at module.exports (/root/aws-lambda-ffmpeg/node_modules/orchestrator/lib/runTask.js:34:7)
at Gulp.Orchestrator._runTask (/root/aws-lambda-ffmpeg/node_modules/orchestrator/index.js:273:3)
at Gulp.Orchestrator._runStep (/root/aws-lambda-ffmpeg/node_modules/orchestrator/index.js:214:10)
at Gulp.Orchestrator.start (/root/aws-lambda-ffmpeg/node_modules/orchestrator/index.js:134:8)
at /usr/lib/node_modules/gulp/bin/gulp.js:129:20
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)

spawn ffmpeg stderr: [swscaler @ 0x30e40b0] No accelerated colorspace conversion found from yuv422p to rgb24.

Running the FFMpeg on AWS lamda as follows:

	const ff = spawn('ffmpeg', args, opts);

	ff.stdout.on('data', data => log('stdout: ', data));
	ff.stderr.on('data', data => {
		console.log(`ps stderr: ${data}`);
		read(outputDir);
		reject;
	});
	ff.on('close', (code) => {
		if (code !== 0) {
			console.log(`ps process exited with code ${code}`);
		}
		resolve;
	});

I receive the following error:

        ps stderr: [swscaler @ 0x30e40b0] No accelerated colorspace conversion found from yuv422p to rgb24.
        ps process exited with code null.

Args passed to FFMPEG function are:

         args:  [ '-y', '-loglevel', 'warning', '-i', '/tmp/download', '-ss', '00:00:5', '-vf', 'thumbnail,scale=320:240', '-frames:v', '1','abc.png' ]

Any tips / suggestions ?

The lambda finishes before generating the output

Hello!

I've tried to run the lambda, as is but I'm having trouble figuring out why it finishes executing early.
I'm running it with the example ffmpeg command if I run this command locally on my machine it works, on the lambda however it appears to never execute.

Below is the output that I can see in the logs.

2017-05-25T19:56:31.061Z	3f011341-1234-123e-1234-xxxxxxxx	Valid video stream found. FFprobe finished.
2017-05-25T19:56:31.061Z	3f011341-1234-123e-1234-xxxxxxxx	Starting FFmpeg
2017-05-25T19:56:31.079Z	3f011341-1234-123e-1234-xxxxxxxx	Deleting /tmp/download
END RequestId: 3f011341-1234-123e-1234-xxxxxxxx
REPORT RequestId: 3f011341-1234-123e-1234-xxxxxxxx	Duration: 376.91 ms	Billed Duration: 400 ms Memory Size: 1536 MB	Max Memory Used: 124 MB

It looks like the /tmp/output directory is always empty, so I feel like there is something failing in the FFMPEG execution itself, I have tried with very short videos, to see if it was an issue of storage or something like that, but it looks like that is not the case.

I'm also using 3 buckets, one for the source file, one for the lambda and one for the destination.
I have in the lambda's environment variables,

DESTINATION_BUCKET=mybucket
VIDEO_MAX_DURATION=180
USE_GZIP=false
MIME_TYPES={"png":"image/png","mp4":"video/mp4"}
FFMPEG_ARGS=-c:a copy -vf scale='min(320\,iw):-2' -movflags +faststart -metadata description=$KEY_PREFIX.mp4 out.mp4 -vf thumbnail -vf scale='min(320\,iw):-2' -vframes 1 out.png

I am unsure if I'm missing a critical configuration somewhere that prevents me from running it, could you please provide me with some guidance as to what might I be missing?

Thanks in advance :)

ffmpeg error code 1

Hi,
i have done all the steps successfully, but i'm getting an error in Lambda.

015-12-08T13:49:47.103Z 8a395219-9db2-11e5-aba9-7b4c9843f0f6 Starting download
2015-12-08T13:49:47.220Z 8a395219-9db2-11e5-aba9-7b4c9843f0f6 starting ffprobe
2015-12-08T13:49:47.256Z 8a395219-9db2-11e5-aba9-7b4c9843f0f6 ffprobe done
2015-12-08T13:49:47.256Z 8a395219-9db2-11e5-aba9-7b4c9843f0f6 valid video stream found
2015-12-08T13:49:47.256Z 8a395219-9db2-11e5-aba9-7b4c9843f0f6 starting ffmpeg
2015-12-08T13:49:47.268Z 8a395219-9db2-11e5-aba9-7b4c9843f0f6 ffmpeg done
2015-12-08T13:49:47.269Z 8a395219-9db2-11e5-aba9-7b4c9843f0f6
{ "errorMessage": "ffmpeg Error code: 1, signal: null" }

Stop FFMPEG upscale video

Dear Binoculars,

I'm trying to scale the video down into multiple resolutions while keeping the aspect ratio (Shrink to fit). If the original video resolution is smaller than the resolution specified in the command, skip transcoding and stop creating the file for that particular resolution.

For example:

I have a video with resolution 1920x1080

Output:
3840x2160 (Skip/Stop)
2560x1440 (Skip/Stop)
1920x1080 (Proceed)
1280x720 (Proceed)

I've tried many commands, but none of them really works. May I know is there any command that are able to achieve this?

Thank you.

Best regards,
Jessica

deployStack fails

I managed to get up to the deployStack gulp task which fails with the following error:

[10:40:14] TypeError: Cannot read property 'Symbol(Symbol.iterator)' of undefined at Parameters.map (/Users/pdt/rumspace/aws-lambda-ffmpeg/platform/aws/gulpfile.js:134:9) at Array.map (native) at Gulp.gulp.task (/Users/pdt/rumspace/aws-lambda-ffmpeg/platform/aws/gulpfile.js:134:5) at module.exports (/Users/pdt/rumspace/aws-lambda-ffmpeg/node_modules/orchestrator/lib/runTask.js:34:7) at Gulp.Orchestrator._runTask (/Users/pdt/rumspace/aws-lambda-ffmpeg/node_modules/orchestrator/index.js:273:3) at Gulp.Orchestrator._runStep (/Users/pdt/rumspace/aws-lambda-ffmpeg/node_modules/orchestrator/index.js:214:10) at Gulp.Orchestrator.start (/Users/pdt/rumspace/aws-lambda-ffmpeg/node_modules/orchestrator/index.js:134:8) at /usr/local/lib/node_modules/gulp-cli/lib/versioned/^3.7.0/index.js:46:20 at _combinedTickCallback (internal/process/next_tick.js:73:7) at process._tickCallback (internal/process/next_tick.js:104:9)

I think CI might be undefined, but didn't see anything in the setup instructions about this:
CI ? ['ExecutionRoleManagedPolicyArn', EXECUTION_ROLE_ARN] : undefined

Readme could be clearer.

Hi there,

I'm admittedly a bit new when it comes to Lambda, but with this repo I'm left to make quite a few assumptions. I realize that the Issues section should not be used for support, but I genuinely think the Readme could be a little more noob friendly, if only be including a few links to read up on certain parts of the process.

Some of these steps may have changed dramatically in the 8 months since the Readme was last updated, so if anyone is able to lend a hand I'd appreciate your guidance.

In particular the Setup section, which left me guessing a few times.

  1. Install node.js, preferably through nvm. Each platform service uses a specific version of Node.js.

Install node.js where? My assumption is on my local machine? Or on the server instance?

  1. Clone this repo git clone ...

If I carry the wrong assumption from #1, perhaps I'll clone it to some server instance.

  1. Run npm install

_Okay, I've done that before. _

  1. Create your function code's storage location (or choose an existing one)

In this scenario I am using AWS Lambda. Some more details on the config might be a little more handy here.

  1. Update the platform-specific configuration JSON file (see below), and/or modify the code file for your purposes

"the platform-specific configuration JSON file" What's the path to it? Does one exist for AWS?

  1. Run Gulp (see below)

This is the first project I've come across that uses Gulp, so a little explanation here would be nice too.

  1. Invoke the function by uploading a video to your source storage location.

A little reasoning about how/what is happening here would be great.

I wasn't able to successfully run the code with these steps. For me I'm stick at running sudo gulp aws:default and getting the following error:

events.js:180
    throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'listener', 'Function');
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "listener" argument must be of type Function
    at _addListener (events.js:180:11)
    at WriteStream.addListener (events.js:240:10)
    at WriteStream.close (fs.js:2302:10)
    at WriteStream.file.on (/Users/mike/smashpotatoes/lambda-function/gulpfile.js:74:8)
    at WriteStream.emit (events.js:164:20)
    at finishMaybe (_stream_writable.js:605:14)
    at afterWrite (_stream_writable.js:456:3)
    at onwrite (_stream_writable.js:446:7)
    at fs.js:2246:5
    at FSReqWrap.wrapper [as oncomplete] (fs.js:703:5)```


Thanks in advance.  

Unclear how to specify AWS credentials

I tried following the README, but it is a little unclear how I specify my AWS credentials.

When running gulp, I am getting GettingTimeoutError: Missing credentials in configinaws:uploadandaws:build-upload`.

I have set the proper bucket names in aws/config.json, but it's not clear by the docs how to specify my AWS credentials to proceed.

Is there a prerequisite or missing piece in the docs? Any clarification would be helpful.

ffprobe not executable on lambda, without some work

I've been playing with this setup and config (thanks) and i've gotten it working, but I had some issues so I wanted to document and see what you thought.

I'm just trying to run ffprobe on some video files...

I'm was getting the following error:

{"code": "EACCES", "errno": "EACCES", "syscall": "spawn"}

I tried chmodding to 777 in pwd (with index.js) - but chmod is disallowed in lambda working dir.

I ended up copying the ffprobe file to /tmp and then chmodding to 777

GCP does not work with env variable config

The dist/ files get packaged with references to process.env.* in them, which are not available inside of Cloud Functions.

I tried using the Babel plugin called transform-inline-environment-variables to inline the variables that are present at the time of transpiling. But that plugin is fragile: It doesn't handle destructuring assignment of envs into consts, and everything breaks if you reassign a process.env key.

simplified

Hey! I have been studying this repository for a while now, and although it seems to do exactly what I am looking for, I am unable to figure out how to implement it. Especially the Gulp part is quite problematic, would you be able to please elaborate a little more in you tutorial? Thanks!

AWS Timeout

Hi I'm getting a timeout when I run aws:default any ideas?

[22:19:33] 'aws:build-upload' errored after 57 s
[22:19:33] RequestTimeout in plugin 'run-sequence(aws:upload)'
Message:
    Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed.
Details:
    code: RequestTimeout
    region: null
    time: Mon May 29 2017 22:19:33 GMT-0700 (PDT)
    requestId: A0946E4F4CBC832A
    extendedRequestId: RH8XRBlPdmAI1BPvsYVTaQqnmg3MLGtR+/vej23V1gXBbIBReVGRTGs8KDOHAEIZNJ6LgxfUpBjO+UJkY+lyAANxNfiu0HSd
    cfId: undefined
    statusCode: 400
    retryable: true
Stack:
RequestTimeout: Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed.
    at Request.extractError (/Users/jeff/video-toad/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/services/s3.js:539:35)
    at Request.callListeners (/Users/jeff/video-toad/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/sequential_executor.js:105:20)
    at Request.emit (/Users/jeff/video-toad/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
    at Request.emit (/Users/jeff/video-toad/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/request.js:673:14)
    at Request.transition (/Users/jeff/video-toad/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/Users/jeff/video-toad/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /Users/jeff/video-toad/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/Users/jeff/video-toad/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/Users/jeff/video-toad/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/request.js:675:12)
    at Request.callListeners (/Users/jeff/video-toad/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/sequential_executor.js:115:18)

Question: gif to mp4

I was able to run the whole stack. Thanks for that.

In order to use a different ffmpeg command I understand that I have to modify (an incoming gif shall be transformed to mp4):

export FFMPEG_ARGS and I would edit MIME_TYPES

Am I correct or wrong?

(terminal command to transform gif to mp4):
ffmpeg -i image.gif -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" video.mp4

I uncommented FFprobe for now, how would you define FFMPEG_ARGS to accomplish this? somehow my mp4s that get created are 0 bytes meaning something is wrong

Problems running on Windows

I have downloaded ffmpeg-git-64bit-static.tar.xz and unpacked in the Build directory and see the ffmpeg and ffprobe files. When I run "npm install" using a Git bash window I receive the following error:

$ npm install

> [email protected] postinstall c:\www\aws-lambda-ffmpeg
> node_modules/.bin/gulp postinstall

'node_modules' is not recognized as an internal or external command,
operable program or batch file.

npm ERR! [email protected] postinstall: `node_modules/.bin/gulp postinstal
l`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is most likely a problem with the aws-lambda-ffmpeg package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node_modules/.bin/gulp postinstall
npm ERR! You can get their info via:
npm ERR!     npm owner ls aws-lambda-ffmpeg
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "c:\\Program Files (x86)\\nodejs\\node.exe" "c:\\Program Files
(x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd c:\www\aws-lambda-ffmpeg
npm ERR! node -v v0.10.22
npm ERR! npm -v 1.3.14
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     c:\www\aws-lambda-ffmpeg\npm-debug.log
npm ERR! not ok code 0

The contents of the Build directory have been removed at this point and no dist folder has been created. Any ideas as to what is occurring?

Adding a watermark to a video

Is it possible to add a watermark to a video? Attempting this with these arguments is producing no output, but works fine locally:

-i 'watermark.png' -filter_complex 'overlay=10:10' -movflags +faststart -c:a copy out.mp4

I'm putting the watermark file in the root of the directory but no luck. I don't get an output from lambda when FFMPEG starts processing:

Valid video stream found. FFprobe finished.
Starting FFmpeg
Deleting /tmp/download
Duration: 259.24 ms Billed Duration: 300 ms Memory Size: 1536 MB Max Memory Used: 41 MB

An in-range update of babel-preset-env is breaking the build 🚨

Version 1.3.0 of babel-preset-env just got published.

Branch Build failing 🚨
Dependency babel-preset-env
Current Version 1.2.2
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As babel-preset-env is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details
Release Notes v1.3.0

v1.3.0 (2017-03-30)

🐛 Bug Fix

We now properly check for Symbol.species support in ArrayBuffer and include the
polyfill if necessary. This should, as a side effect, fix ArrayBuffer-related
errors on IE9.

💅 Polish

We've simplified things by adding electron as a target instead of doing a bunch of
things at runtime. Electron targets should now also be displayed in the debug output.

If you are targeting the node environment exclusively, the always-included web polyfills
(like dom.iterable, and a few others) will now no longer be included.

📝 Documentation

🏠 Internal

  • npmignore: Add related to build data and codecov. (#216) (@yavorsky)
Commits

The new version differs by 8 commits .

  • 8b2dc4f 1.3.0
  • 6ebf857 Update changelog
  • 046f326 Add check for ArrayBuffer[Symbol.species] (#233)
  • aead61c Fill data with electron as a target. (#229)
  • 48a329b separate default builtins for platforms (#226)
  • a4d585c remove deprecated projects (#223) [skip ci]
  • 88cbe17 Merge pull request #216 from babel/update-npmignore
  • cf94af3 npmignore: Add related to build data and codecov.

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Error with Installation (Access Denied)

Dear Binoculars,

I'm new to Github, AWS, Lambda, CloudFormation, Linux and FFMPEG. I'm trying to get this working with AWS, but no luck on that, I keep on getting errors and most of them are Access Denied. I've tried the below. I believe I've done some mistake somewhere, but I'm unable to find the problem source. It might be AWS access key, bucket policy problem, npm or maybe config.json?

`export AWS_ACCESS_KEY_ID=AKIDEXAMPLE
export AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY
export AWS_REGION=us-east-1
export DESTINATION_BUCKET=destination-bucket

Note that the following variable is single-quote escaped. Use $KEY_PREFIX to get the filename minus the extension.

export FFMPEG_ARGS=$'-c:a copy -vf scale='min(320\,iw):-2' -movflags +faststart -metadata description=http://my.site/$KEY_PREFIX.mp4 out.mp4 -vf thumbnail -vf scale='min(320\,iw):-2' -vframes 1 out.png'
export USE_GZIP=false
export MIME_TYPES='{"png":"image/png","mp4":"video/mp4"}'
export VIDEO_MAX_DURATION='30'

Node version

nvm use 6.10 # This is subject to change

Babel-node test script

node node_modules/babel-cli/bin/babel-node.js test/aws.js`

[hello@localhost aws-lambda-ffmpeg]$ CFN_S3_BUCKET=lambda-testfunction gulp aws:create-cfn-bucket [17:13:23] Using gulpfile ~/aws-lambda-ffmpeg/gulpfile.js [17:13:23] Starting 'aws:create-cfn-bucket'... { AccessDenied: Access Denied at Request.extractError (/home/hello/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/services/s3.js:539:35) at Request.callListeners (/home/hello/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/sequential_executor.js:105:20) at Request.emit (/home/hello/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/sequential_executor.js:77:10) at Request.emit (/home/hello/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/request.js:671:14) at Request.transition (/home/hello/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/request.js:22:10) at AcceptorStateMachine.runTo (/home/hello/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/state_machine.js:14:12) at /home/hello/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/state_machine.js:26:10 at Request.<anonymous> (/home/hello/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/request.js:38:9) at Request.<anonymous> (/home/hello/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/request.js:673:12) at Request.callListeners (/home/hello/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/sequential_executor.js:115:18) message: 'Access Denied', code: 'AccessDenied', region: null, time: 2017-04-24T21:13:25.352Z, requestId: 'xxxxxxxxxxxxxxxxx', extendedRequestId: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', cfId: undefined, statusCode: 403, retryable: false, retryDelay: 22.117309923917226 } [17:13:25] Finished 'aws:create-cfn-bucket' after 1.67 s

May I know is there any video tutorial available for newbies? It would be great if you could guide me on this, thank you.

Best regards,
Jessica

gulp aws:update error "InvalidParameterType: Expected params.FunctionName to be a string"

I may be doing something silly, but I'm getting this error when I try to push up changes:

[18:52:57] Using gulpfile ~/code/learn/aws-lambda-ffmpeg/gulpfile.js
[18:52:57] Starting 'aws:update'...
[18:52:57] Starting 'aws:build-upload'...
[18:52:57] Starting 'clean'...
[18:52:57] Finished 'clean' after 23 ms
[18:52:57] Starting 'download-ffmpeg'...
[18:53:00] Finished 'download-ffmpeg' after 3.58 s
[18:53:00] Starting 'aws:transpile'...
[18:53:00] Starting 'aws:config'...
[18:53:00] Finished 'aws:config' after 15 ms
[18:53:01] Finished 'aws:transpile' after 751 ms
[18:53:01] Starting 'aws:source'...
[18:53:01] Finished 'aws:source' after 10 μs
[18:53:01] Starting 'npm'...
[18:53:02] Finished 'npm' after 1.23 s
[18:53:02] Starting 'untar-ffmpeg'...
x ./
x ./ffmpeg
x ./ffprobe
x ./README.txt
x ./COPYING.GPLv3
[18:53:03] Finished 'untar-ffmpeg' after 367 ms
[18:53:03] Starting 'copy-ffmpeg'...
[18:53:03] Finished 'copy-ffmpeg' after 220 ms
[18:53:03] Starting 'zip'...
[18:53:06] Finished 'zip' after 3.16 s
[18:53:06] Starting 'aws:upload'...
[18:53:10] Finished 'aws:upload' after 3.41 s
[18:53:10] Finished 'aws:build-upload' after 13 s
[18:53:10] Starting 'aws:updateCode'...
[18:53:10] 'aws:updateCode' errored after 465 ms
[18:53:10] InvalidParameterType: Expected params.FunctionName to be a string
    at ParamValidator.fail (/Users/briankeane/code/learn/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/param_validator.js:50:37)
    at ParamValidator.validateType (/Users/briankeane/code/learn/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/param_validator.js:218:10)
    at ParamValidator.validateString (/Users/briankeane/code/learn/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/param_validator.js:150:14)
    at ParamValidator.validateScalar (/Users/briankeane/code/learn/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/param_validator.js:130:21)
    at ParamValidator.validateMember (/Users/briankeane/code/learn/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/param_validator.js:94:21)
    at ParamValidator.validateStructure (/Users/briankeane/code/learn/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/param_validator.js:75:14)
    at ParamValidator.validateMember (/Users/briankeane/code/learn/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/param_validator.js:88:21)
    at ParamValidator.validate (/Users/briankeane/code/learn/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/param_validator.js:34:10)
    at Request.VALIDATE_PARAMETERS (/Users/briankeane/code/learn/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/event_listeners.js:108:42)
    at Request.callListeners (/Users/briankeane/code/learn/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/sequential_executor.js:105:20)
[18:53:10] 'aws:update' errored after 13 s
[18:53:10] InvalidParameterType in plugin 'run-sequence(aws:updateCode)'
Message:
    Expected params.FunctionName to be a string
Details:
    code: InvalidParameterType
    time: Wed Apr 19 2017 18:53:10 GMT-0500 (CDT)
Stack:
InvalidParameterType: Expected params.FunctionName to be a string
    at ParamValidator.fail (/Users/briankeane/code/learn/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/param_validator.js:50:37)
    at ParamValidator.validateType (/Users/briankeane/code/learn/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/param_validator.js:218:10)
    at ParamValidator.validateString (/Users/briankeane/code/learn/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/param_validator.js:150:14)
    at ParamValidator.validateScalar (/Users/briankeane/code/learn/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/param_validator.js:130:21)
    at ParamValidator.validateMember (/Users/briankeane/code/learn/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/param_validator.js:94:21)
    at ParamValidator.validateStructure (/Users/briankeane/code/learn/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/param_validator.js:75:14)
    at ParamValidator.validateMember (/Users/briankeane/code/learn/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/param_validator.js:88:21)
    at ParamValidator.validate (/Users/briankeane/code/learn/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/param_validator.js:34:10)
    at Request.VALIDATE_PARAMETERS (/Users/briankeane/code/learn/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/event_listeners.js:108:42)
    at Request.callListeners (/Users/briankeane/code/learn/aws-lambda-ffmpeg/node_modules/aws-sdk/lib/sequential_executor.js:105:20)

The only place I found "FunctionName" was in the The LamdaPermission section of cloudformation.json:

"LambdaPermission": {
			"Type": "AWS::Lambda::Permission",
			"DependsOn": [
				"Lambda"
			],
			"Properties": {
				"Action": "lambda:invokeFunction",
				"FunctionName": {
					"Fn::GetAtt": [
						"Lambda",
						"Arn"
					]
				},
				"Principal": "s3.amazonaws.com",
				"SourceAccount": {
					"Ref": "AWS::AccountId"
				},
				"SourceArn": {
					"Fn::Join": [
						"",
						[
							"arn:aws:s3:::",
							{
								"Ref": "SourceBucketName"
							}
						]
					]
				}
			}
		},

Could you give me some guidance on how to solve it?

LOVE this library, btw. Thank you for the great work.

how to upload files for Azure

Hi,

I see that the gulpfile.js for Azure is empty and there are no tasks defined in that.

I have used your code with AWS and it works fine over there. But I can't use AWS as I need to transcode big files and in AWS lambda the max timeout is 5 mins and for transcoding it is taking more than that.

Could you please update the gulpfile for Azure? Or let me know how can it be done for Azure

An in-range update of babel-cli is breaking the build 🚨

Version 6.24.1 of babel-cli just got published.

Branch Build failing 🚨
Dependency babel-cli
Current Version 6.24.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As babel-cli is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details
Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Difficulties with running gulp build task (aws enviroment)

Hi binoculars,
Thanks for this great build tool, I'm actually having some difficulties with running gulp build task:
1-is it normal that the generated dist folder has no file inside /dist/node_modules/ ? my dist.zip file is about ~ 5ko, no libs(ffmpeg) inside it?
2-the cloud formation is stack on Rollback in progress -> Rollback Completed, I guess something is broken!
3-the aws-lambda-ffmpeg.zip is indeed uploaded to s3, but no lambda function is created

When I run gulp aws:default for the first time, I got no error
When I run gulp aws:deployStack, I got Stack:arn:aws:cloudformation:eu-west-1:xxxxxxx:stack/aws-lambda-ffmpeg/xxxxxx is in ROLLBACK_COMPLETE state and can not be updated
When I run gulp aws:update, I got Resource Lambda does not exist for stack aws-lambda-ffmpeg

Is there some thing that you see or notice that could trigger these errors?

cheers

trying to restart the proccess

hi,

i'm trying to restart my aws-lambda-ffmpeg. iv'e deleted the bucket it created on my s3 service on aws. when i recreate all the Environment Settings (with different bucket names) and then running 'gulp aws:default' i get the next error:
ValidationError: Stack:arn:aws:cloudformation:ap-southeast-2:384975490864:stack/aws-lambda-ffmpeg/8b422530-3ae1-11e7-8bc2-50fae94face6 is in ROLLBACK_COMPLETE state and can not be updated.

it also doesn't create a lambda function in the aws lambda service.
is there any way to delete everything and start from the begining?

thanks :)

Validation Error: S3 ..

Thanks for making such a great system here. This definitely saves me some time.

I have tested successfully, but on deploying, I get this error, and the CloudFormation and Lambda are never created. I created the bucket using gulp aws:create-cfn-bucket. The zip file and the cloudformation.template were succesfully loaded into the bucket in deploy into q-transcode-lambda/aws-lambda...

However, it seems that it failed to fetch the cloudformation.template, I'm not sure why it's trying to use the public/https address to fetch it, I would think that whatever needed that template would fetch the key directly from s3. Is there some additional permission setting I need to make on the q-transcode-lambda bucket?

[14:19:38] Starting 'aws:deployStack'...
[14:19:38] Finished 'aws:default' after 26 ms
[14:19:38] Finished 'clean' after 48 ms
[14:19:38] Starting 'download-ffmpeg'...
{ ValidationError: S3 error: Unable to get the object https://s3.amazonaws.com/q-transcode-lambda/aws-lambda-ffmpeg/cloudformation.template
...

An in-range update of simple-git is breaking the build 🚨

Version 1.71.0 of simple-git just got published.

Branch Build failing 🚨
Dependency simple-git
Current Version 1.70.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As simple-git is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Commits

The new version differs by 6 commits0.

  • 5d22a74 Release 1.71.0
  • 0dab00c Merge branch 'jorritd-master'
  • 8373b81 Lint, split tests into separate file, add in the author related detail when present
  • 23ab0f3 Fixes #174
  • 5d695ff Update CommitSummary.js
  • fcf9324 Fix documentation for tags

false

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

No need for ffmpeg filesystem operations

Hi

Thanks for this repo - it's proven to be very useful for me.

I did find one problem though, which was the need to copy the ffmpeg binaries to the /tmp directory. I was running into problems because this step had to be performed synchronously so that the binaries were actually available prior to executing them.

As it turns out, you don't actually need to do this at all. All you need to do is update the PATH variable at the start of your function and the binaries are immediately available. Just do this:

process.env[‘PATH’] = process.env[‘PATH’] + ‘:’ + process.env[‘LAMBDA_TASK_ROOT’]

More info here: https://aws.amazon.com/blogs/compute/running-executables-in-aws-lambda/

Thanks,
Ed.

CloudFormation issue

I'm getting the error below every time I'm running AWS:DEFAULT.
I set all full access permissions on IAM for my user to make sure it has the right permission to create whatever it needed but still.

CREATE_FAILED AWS::IAM::Policy ExecutionRolePolicy Value of property Roles must be of type List of String

Any tip?

screenshot 2017-03-15 15 26 20

Handle multiple output files

Hey,

Is there a way of changing the FFMPEG_ARGS in a way that we will be able to create in the output bucket different videos of different types?
I tried to change the code directly in aws lambda service and this is the code i'm trying to use (taken from #37 ):

-c:a copy -vf scale='min(320\,iw):-2' -movflags +faststart -metadata description=http://my.site/$KEY_PREFIX_320.mp4 out_320.mp4 -vf thumbnail -vf scale='min(320\,iw):-2' -vframes 1 out_320.png -c:a copy -vf scale='min(640\,iw):-2' -movflags +faststart -metadata description=http://my.site/$KEY_PREFIX_640.mp4 out_640.mp4** -vf thumbnail -vf scale='min(640\,iw):-2' -vframes 1 out_640.png

Eventually it is overwritten by the original FFMPEG_ARGS and outputs the $KEY_PREFIX.mp4 and $KEY_PREFIX.png.

Do i need to modify the code of the lambda fucntion? or is there a way to overcome this using the arguments?
and a more general question is it valid to change the values of the environment directly on aws lambda service?

Thanks again for the help:)

Cannot find module 'async'

I upload a file to S3 and lamda run, but with error.

{ "errorMessage": "Cannot find module 'async'", "errorType": "Error", "stackTrace": [ "Function.Module._resolveFilename (module.js:338:15)", "Function.Module._load (module.js:280:25)", "Module.require (module.js:364:17)", "require (module.js:380:17)", "Object.<anonymous> (/var/task/index.js:12:13)", "Module._compile (module.js:456:26)", "Object.Module._extensions..js (module.js:474:10)", "Module.load (module.js:356:32)", "Function.Module._load (module.js:312:12)", "Module.require (module.js:364:17)" ] }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.