This code works perfectly from my local machine.
import subprocess
p = subprocess.call('ffmpeg -r 1 -loop 1 -i "ep1.png" -i "ep1.mp3" -acodec copy -r 1 -shortest -vf scale=1280:720 ep1.flv',shell=True)
I would like to run it from AWS
Lambda code
import boto3
import subprocess
s3 = boto3.client('s3')
def lambda_handler(event, context):
ep1PNG = s3.get_object(Bucket='my-buc',Key='ep1.PNG')
ep1MP3 = s3.get_object(Bucket='my-buc',Key='ep1.mp3')
p = subprocess.call(
'/opt/ffmpeg/ffmpeg -r 1 -loop 1 -i ep1PNG -i ep1MP3 -acodec copy -r 1 -shortest -vf scale=1280:720 /tmp/ep1.flv', shell=True)
# TODO implement
return {
'statusCode': 200,
}
Questions
Are these correct inside subprocess.call() ?
/opt/ffmpeg/ffmpeg #<-----Is this correct ?
ep1PNG #<-----Is this correct ?
ep1MP3 #<-----Is this correct ?
/tmp/ep1.flv #<----- Not Sending Output to S3 Bucket
Please comment if I'm heading in the right direction been trying this for about a week now
ffmpeg is uploaded as a layer