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

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

问题描述

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

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 来从 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. Compute Engine 和 Cloud Storage 之间的带宽是免费的.
  2. 身份验证很简单.

或者,您可以为视频文件使用签名 URL.这样您就不必为了流式传输目的而开发/部署单独的 Compute Engine 实例 - 您现有的后端可以返回签名网址.

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天全站免登陆