[英]Boto3 Video Upload 0 Bytes from Heroku
I have a small Flask api that takes a video and an image, overlays the image on the video and uploads the result to Amazon S3. 我有一个小的Flask API,可拍摄视频和图像,将图像覆盖在视频上并将结果上传到Amazon S3。 I am using ffmpeg to do the actual overlaying.
我正在使用ffmpeg进行实际的覆盖。 Here is that code:
这是该代码:
command = "ffmpeg -i {0} -i {1} -filter_complex \"overlay=0:0\" {2}".format(background_name, overlay_name, output_name)
subprocess.getoutput(command)
Then I simply upload it via Boto3: 然后我只需通过Boto3上传它:
s3.upload_file(output_name, VIDEO_BUCKET_NAME, output_name)
This code works fine when I run on localhost; 当我在localhost上运行时,此代码工作正常; however, when I test in while deployed to Heroku, it always uploads a file with 0 bytes.
但是,当我在部署到Heroku时进行测试时,它始终会上传一个0字节的文件。 I suspect that it may be a problem with Heroku's transient filesystem, but the file is being used immediately after it is created.
我怀疑这可能与Heroku的临时文件系统有关,但是在创建文件后立即使用该文件。
我知道这并不能真正回答我的问题,但是我从Heroku上删除了API,并将其部署在AWS Elastic Beanstalk上,现在图像和视频上传均可正常工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.