目标:
我已经创建了一个包含静态ffmpeg的图层
错误:
{
"errorMessage": "[Errno 2] No such file or directory: '/tmp/output.mp4'","errorType": "FileNotFoundError","stackTrace": [
[
"/var/task/lambda_function.py",19,"lambda_handler","s3.Object(bucketLowRes,mp4OutputFileName).put(Body=open(new_file_key,'rb'))"
]
]
}
我的Lambda函数:
import json
import os
import subprocess
import boto3
s3 = boto3.resource('s3')
bucketLowRes = s3.Bucket("bucket-conc-lowres")
def lambda_handler(event,context):
# TODO implement
mp4OutputFileName = 'output.mp4'
new_file_key = os.path.abspath(os.path.join(os.sep,'tmp',mp4OutputFileName))
subprocess.call( ['/opt/ffmpeg','-i','concat:s3://bucket-word-clips/00th76kqwfs915hbixycb77y9v3riwsj30.mp4|s3://bucket-word-clips/00uoakp6jyafbu13ycvl6w2i9tj42eux30.mp4',new_file_key ] )
s3.Object(bucketLowRes,'rb'))
return {
'statusCode': 200,'body': json.dumps('Hello from Lambda!')
}
问题:
- FileNotFoundError:我的ffmpeg concat的输出mp4文件保存在哪里?
- 如果将其保存到/tmp/output.mp4,那么为什么FileNotFoundError ??
谢谢