将视频上传到Cloudinary [英] Upload video to Cloudinary

查看:100
本文介绍了将视频上传到Cloudinary的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前在Heroku上托管一个基于Rails的站点,并允许用户上传个人图像和视频。我目前将它们存储在S3上,并且视频编码由Zencoder完成。到目前为止,我对此非常满意,但是我想使用Cloudinary之类的服务。我创建了一个演示应用程序,该应用程序可以上传到Cloudinary,并且对它的工作方式感到非常满意,但对于视频却似乎不起作用。我知道Cloudinary不执行任何编码,因此我不希望他们这样做。我仍将使用Zencoder,但只想在一个位置存储所有媒体文件。



有没有人使用过这种方法,或者在解决此问题的更好方法上有一些想法?

解决方案

能否请您解释一下这似乎不起作用的含义?
您遇到什么问题?



您可以将任何文件类型上传到Cloudinary,而不仅仅是图像。所有非图像文件(包括视频文件)均作为原始文件处理。
这是一个WMV文件到您的Cloudinary帐户的上传示例:

  Cloudinary :: Uploader.upload( sample_video .wmv,:public_id => sample_video,:resource_type =>:raw)

为了进行传送,应使用返回的上载API调用的公共ID。
这是一个URL示例,请注意'... / raw / upload ...'

  http://res.cloudinary.com/demo/raw/upload/sample_video.wmv 

有关更多信息:
http://cloudinary.com/blog/using_cloudinary_to_manage_all_your_website_s_ / p>

I currently have a Rails based site that is hosted on Heroku and allows users to upload personal images and videos. I am currently storing them on S3 with the video encoding being done by Zencoder. So far pretty happy with this however I would like to use a service such as Cloudinary. I have created a demo app that uploads to Cloudinary and am very happy with the way it works but with video this does not seem to be working. I am aware that Cloudinary does not do any encoding and I am not looking for them to do that. I will still use Zencoder but would just like one place to store all of the media files.

Is there anyone that has used this approach or maybe some ideas on a better way to solve this problem?

解决方案

Can you please explain what you meant by "this does not seem to be working"? What issues were you experiencing?

You can upload any file type to Cloudinary, not just images. All non-images files, included video files are handled as 'raw' files. Here's an upload example of a WMV file to your Cloudinary account:

Cloudinary::Uploader.upload("sample_video.wmv", :public_id => "sample_video", :resource_type => :raw)

For delivery, the returned public ID of the upload API call should be used. Here's a URL example , notice the '.../raw/upload...' :

http://res.cloudinary.com/demo/raw/upload/sample_video.wmv

For more information: http://cloudinary.com/blog/using_cloudinary_to_manage_all_your_website_s_assets_in_the_cloud

这篇关于将视频上传到Cloudinary的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆