使用 Paperclip 将视频上传到 Heroku - 如何制作缩略图?
我刚刚将使用回形针上传视频添加到 Heroku 上的 Rails 3 应用程序中。它工作正常,但我不知道如何生成视频的缩略图。我想我应该使用 heroku 中的视频处理插件之一?
有什么建议最容易连接到 Paperclip 吗?
I've just added video uploading with paperclip to a Rails 3 app I have on Heroku. It works fine but I don't know how to generate thumbnails for the videos. I guess I should use one of the video processing add-ons in heroku?
Any recommendations for which are easiest to connect to Paperclip?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我们目前使用 Zencoder 编码服务对视频上传进行编码。这很棒,因为他们的服务提供了视频文件的缩略图生成。
我建议在网络应用程序之外执行任何资源密集型流程,例如编码。因为这可能需要整个 HTTP 请求处理程序(或者在您的情况下是一个 Web dyno)。当然,您可以请求更多网络测功机。但这些都很贵。
另一种选择是在后台进行处理。但此类任务在网络服务器之外会更好。这就是 Zencoder 这样的 API 服务的用武之地。
以下是一组帮助您入门的说明。
另一种选择是Panda Stream。 Heroku 确实提供了一个插件。 Panda Stream 和 Zencoder 都会满足您的需求。两者也有不同的价格型号。不幸的是,我无法向您提供有关 Panda 的更多信息,因为我没有使用过它们。
至于使用哪个上传器。回形针就能很好地完成这项工作。我猜测,因为您正在使用 Heroku,并且您正在上传到 Amazon S3。在我们的环境中,我们使用 Carrierwave。
We currently use the Zencoder encoding service to encode video uploads. Which is great, because their service provides thumbnail generation on video files.
I would advise doing any resource intensive processes, such as encoding, outside the web app. As this can take an entire HTTP Request handler (or in your case a web dyno). Sure you can request for more web dynos. But these are expensive.
An alternative option is to do the processing in the background. But such tasks would be better off outside the web server. This is where an API service like Zencoder comes well.
Here's a set of instructions to get you started.
Another alternative is Panda Stream. Which Heroku does offer as an addon. Both Panda Stream and Zencoder will do what you need. Both also go on different price models. Unfortunately, I cannot give you any more info on Panda, since I haven't used them.
As far as which uploader to use. Paperclip will do the job fine. I am guessing, since you are using Heroku, and you are uploading to Amazon S3. On our environment, we are using Carrierwave.