我一直未能在Heroku上以生产模式上传视频太长时间,在调整大小和创建缩略图时测试本地作品非常棒。图像也可以正常运行到我的S3存储桶,因此凭据都可以。
以下是我通常从下面使用的代码中获取的日志。顺便提一下,在我获得这些日志之前的尝试(没有更改任何代码和使用相同的测试视频),视频进入AWS,只是没有调整大小或创建缩略图。但那是我唯一一次做到这一点,这次失败的上传和500错误之后立即发生。
$ heroku logs
2015-08-06T15:38:39.732913+00:00 app[web.1]: Started POST "/work/create" for 104.162.101.0 at 2015-08-06 15:38:39 +0000
2015-08-06T15:38:39.696998+00:00 app[web.1]: source=rack-timeout id=dd06eb06-cad5-4236-8788-e5f59f7fe631 wait=7850ms timeout=15000ms service=0ms state=active
2015-08-06T15:38:39.734677+00:00 app[web.1]: Processing by WorksController#create as HTML
2015-08-06T15:38:39.734744+00:00 app[web.1]: Parameters: {"utf8"=>"✓", "authenticity_token"=>"9edyQVZm68aW+majARmNcDR1dwpE59ZrWEZ4/G07ADYhlZyYiJ+RwYK4GBguQZbrlS6J4yDbMsMIxcvWLD3aUA==", "work"=>{"position"=>"", "media_type"=>"video", "video"=>#<ActionDispatch::Http::UploadedFile:0x007efee96e14e8 @tempfile=#<Tempfile:/tmp/RackMultipart20150806-3-1mu6ibh.mp4>, @original_filename="FA14 final_compilation_mg4d_H.264.mp4", @content_type="video/mp4", @headers="Content-Disposition: form-data; name=\"work[video]\"; filename=\"FA14 final_compilation_mg4d_H.264.mp4\"\r\nContent-Type: video/mp4\r\n">, "designer"=>""}}
2015-08-06T15:38:40.030596+00:00 heroku[router]: at=info method=POST path="/work/create" host=purchasedesign.herokuapp.com request_id=dd06eb06-cad5-4236-8788-e5f59f7fe631 fwd="104.162.101.0" dyno=web.1 connect=1ms service=8181ms status=500 bytes=192
2015-08-06T15:38:40.017315+00:00 app[web.1]: Command :: file -b --mime '/tmp/9b4d56c6bf75dc6718768cda6940025a20150806-3-14gq1uq.mp4'
2015-08-06T15:38:40.025037+00:00 app[web.1]: [AV] Running command: if command -v ffmpeg 2>/dev/null; then echo "true"; else echo "false"; fi
2015-08-06T15:38:40.028329+00:00 app[web.1]:
2015-08-06T15:38:40.028332+00:00 app[web.1]: Av::UnableToDetect (Unable to detect any supported library):
2015-08-06T15:38:40.028333+00:00 app[web.1]: app/controllers/works_controller.rb:18:in `create'
2015-08-06T15:38:40.028335+00:00 app[web.1]:
2015-08-06T15:38:40.028336+00:00 app[web.1]:
2015-08-06T15:38:40.028629+00:00 app[web.1]: source=rack-timeout id=dd06eb06-cad5-4236-8788-e5f59f7fe631 wait=7850ms timeout=15000ms service=332ms state=completed
2015-08-06T15:38:40.023226+00:00 app[web.1]: [AV] Running command: if command -v avprobe 2>/dev/null; then echo "true"; else echo "false"; fi
2015-08-06T15:38:40.027118+00:00 app[web.1]: Completed 500 Internal Server Error in 292ms
模型/ work.rb
has_attached_file :video,
:styles => {
:mp4 => {
:geometry => "640x480",
:format => 'mp4',
},
:thumb => {
:geometry => '300x300',
:format => 'jpg',
:time => 10
}
},
:processors => [:transcoder]
的Gemfile
gem 'aws-sdk', '< 2.0'
gem 'paperclip', '~> 4.2'
gem 'paperclip-ffmpeg', '~> 1.0.0'
gem 'paperclip-av-transcoder'
gem 'delayed_paperclip'
gem 'rmagick', '~> 2.13.4'
配置/环境/ production.rb
config.paperclip_defaults = {
:storage => :s3,
:s3_credentials => {
:bucket => ENV['S3_BUCKET_NAME'],
:access_key_id => ENV['AWS_ACCESS_KEY_ID'],
:secret_access_key => ENV['AWS_SECRET_ACCESS_KEY']
}
}
任何帮助都会令人难以置信
答案 0 :(得分:0)