简体   繁体   English

在Rails中使用AWS-SDK Gem,CarrierWave和Sidekiq进行代码转换

[英]Transcoding with AWS-SDK Gem, CarrierWave, and Sidekiq in Rails

I have a rails app that should allow users to upload videos and stream them. 我有一个rails应用程序,应该允许用户上传视频并流式传输。 I'm using carrierwave-direct to upload the video files. 我正在使用carrierwave-direct上传视频文件。 Carrierwave-direct utilizes fog to upload directly to an Amazon S3 bucket. Carrierwave-direct利用雾直接上传到Amazon S3存储桶。 I kick off a background job for the upload using Sidekiq. 我使用Sidekiq开始上传后台工作。 This all works. 这一切都有效。

I now need to transcode each video as it is uploaded. 我现在需要在上传视频时对其进行转码。 I plan on using Amazon's Elastic Transcoder to do this. 我计划使用亚马逊的Elastic Transcoder来做到这一点。 How do I kick off the transcoder with Sidekiq? 如何使用Sidekiq启动转码器? After the file is uploaded, how do I use the AWS-SDK gem with Sidekiq to start a transcoding job and have a file from s3 be converted? 上传文件后,如何使用Sidekiq的AWS-SDK gem启动转码作业并转换来自s3的文件? Will I need a new background worker for this job? 我是否需要一名新的背景工作者来完成这项工作? Can I just use only one worker for this? 我可以只使用一名工人吗? I'm lost on this issue. 我迷失在这个问题上。 I have looked everywhere and the documentation on actually using the elastic transcoder is thin. 我到处寻找,实际使用弹性转码器的文档很薄。

I'm looking for a more general answer and a sample just so that I can get started. 我正在寻找一个更一般的答案和样本,以便我可以开始。 Once I know how to handle this process I think that I can manage. 一旦我知道如何处理这个过程,我认为我可以管理。

I think you need sidekick only to manage your own jobs. 我认为你只需要帮助来管理你自己的工作。 Elastisc Transcoder (ETS) is a job worker, only that you need is know when ETS has finished to converting your video. Elastisc Transcoder(ETS)是一名工作工作者,只有当ETS完成转换视频时才知道您需要的工作人员。 I'm trying to kick-off a way to do that, and update my file in the resource to get the url for the converted video. 我正试图启动一种方法,并在资源中更新我的文件以获取转换后视频的网址。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM