存储、流式传输视频和使用REST API处理请求

huangapple go评论74阅读模式
英文:

Storing, Streaming videos and handling requests using REST APIs

问题

我正在尝试创建一个Web服务器(REST API),它应该能够存储、组织和流式传输视频以响应客户端请求。

我的困惑:

  • 用户应该如何上传视频?经过研究,我决定将所有视频的元数据存储在数据库(Google Datastore)中,将所有视频文件存储在单独的存储中(Google Cloud Storage)。现在,如何上传视频是正确的方式?
  • 一旦视频上传并存储好,如何进行流式传输?假设用户发出观看视频的请求,服务器将收到一个HTTP请求。但是如何进行视频流式传输?是否有相应的服务可用?因为直接在代码中使用HTTP流式传输可能会影响性能。

根据我的理解,我希望使用一个服务,该服务能够在服务器请求时从存储中流式传输视频到客户端。我猜想服务器应该在验证用户凭据后才能向这个“视频流式传输服务”发出请求。

英文:

I am trying to create a web server(REST APIs), which should be able to store, organise and stream videos for a client request.

My confusion:

  • How should a user can upload videos. From research, I decided that I would store all the metadata for the videos in database(google datastore), and all the video files in separate storage(Google cloud storage). Now, to upload videos, what is the proper way?
  • Once a video is uploaded and stored, how will the streaming will happen. Suppose a user make a request to watch a video, server will get a http request for that. But how to stream videos? Is there any service for this? Because using http streaming directly in code affects performance I guess.

From my understanding, I want to use a service which should be able to stream videos from my storage to a client upon the server's request. I guessed the server should make request to this "video streaming service" only after verifying the user credentials.

答案1

得分: 1

问题1(如何让客户上传对象),签名URL是一个不错的选择。

问题2比较复杂。根据您的需求,您可以简单地将客户指向GCS视频文件,但现代媒体服务比这更高级一些。您可能需要考虑使用带有流媒体视频服务的GCE,例如像Wowza这样的服务。Google为其提供了一键部署的体验:http://cloud.google.com/tryitnow/wowza

(请注意,Wowza是一个独立的产品,需要付费许可证。我对它没有任何经验,也不是它的支持者或反对者)。

英文:

For question 1 (how to enable customers to upload objects), signed URLs are a good bet.

Question 2 is a lot bigger. Depending on your needs you could simply point clients to GCS video files, but modern media serving is a bit more advanced than that. You may want to look into using GCE with a streaming video service, for example something like Wowza. Google offers a click-to-deploy experience for it: http://cloud.google.com/tryitnow/wowza

(Keep in mind that Wowza is a separate products requiring a paid license. I don't have any experience with it and neither advocate for nor disapprove of it).

huangapple
  • 本文由 发表于 2015年9月18日 14:08:32
  • 转载请务必保留本文链接:https://go.coder-hub.com/32644953.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定