这段代码在我的本地机器上运行良好。
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)
Run Code Online (Sandbox Code Playgroud)
我想从 AWS 运行它
拉姆达代码
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,
}
Run Code Online (Sandbox Code Playgroud)
问题
这些在 subprocess.call() 中是否正确?
/opt/ffmpeg/ffmpeg #<-----Is this correct ? …
Run Code Online (Sandbox Code Playgroud)