来自Google Cloud Storage的视频流 [英] Video Streaming from Google Cloud Storage

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

问题描述

我们将如何从Google云存储中获取视频并将其流式传输到移动设备上?

How would we go about getting a video from google cloud storage and streaming that video to a mobile device?

我没有看到与Java API中的视频相关的任何内容,就像使用ImagesServiceFactory

I dont see anything related to videos in the Java API like there is for getting images with ImagesServiceFactory

如果有任何区别的话,视频最长不会超过10-15秒.

The videos are only going to be a maximum of 10-15 seconds long if that makes any difference.

任何有关如何进行此处操作的建议都很好

Any advice on how to proceed here would be great

推荐答案

流传输视频与从Cloud Storage下载任何其他文件之间没有区别.因此,没有特殊的视频API.

There is no difference between streaming a video and downloading any other file from the Cloud Storage. Thus, no special video API.

如果文件不是公开的,则需要一个servlet,该servlet将从Cloud Storage中读取视频的内容并将其流式传输到客户端.请注意,您不能在App Engine或托管VM上运行它,因为它们不支持文件流传输,并且请求大小限制为32MB.

If the files are not public, you need a servlet that will read the content of the video from Cloud Storage and stream it to the client. Note that you cannot run it on App Engine or managed VM as they do not support file streaming and the request size is limited to 32MB.

您最好的选择是在Compute Engine实例上运行它:

Your best option is to run this on a Compute Engine instance:

  1. 计算引擎和云存储之间的带宽是免费的.
  2. 身份验证很简单.

或者,您可以对视频文件使用签名的URL.这样一来,您就不必为开发流而开发/部署单独的Compute Engine实例-签名的URL可以由您现有的后端返回.

Alternatively, you may use a signed URL for your video files. This saves you from developing/deploying a separate Compute Engine instance just for the streaming purposes - signed URLs can be returned by your existing backend.

这篇关于来自Google Cloud Storage的视频流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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