Firebase存储视频流 [英] Firebase Storage Video Streaming

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

问题描述

我正在开发一个具有视频流功能的应用程序。我正在使用Firebase数据库和Firebase存储。我试图找到一些关于firebase存储如何处理视频文件的文档,但是真的找不到。



在文档中提到,firebase存储与其他谷歌应用服务允许CDN和视频流,但所有的搜索似乎导致死胡同。任何建议?

解决方案

我认为有几种类型的视频流,可以改变我们的答案:


  • 直播(订阅者正在观看事件发生)
  • Youtube风格(在方便的时候发布视频和最终用户)



使用Firebase存储和Firebase实时数据库构建了一个实时流式Periscope样式应用程序,我强烈建议不要这样做 - 我们上传了三个第二块,并通过实时数据库同步它们。虽然它的工作(令人惊讶的是),但是在非常好的互联网上有5秒的延迟,而且也不是最有效的解决方案(毕竟,你上传和存储视频,而且没有任何转码) 。我建议使用一些WebRTC风格,为视频传输而构建,并使用实时数据库在信息流旁边进行信号传输。另一方面,构建移动设备YT Firebase功能。这里的诀窍是将视频转码(使用Zencoder或Bitmovin等更多内容: https:/ /cloud.google.com/solutions/media/ )将您上传的视频分成不同分辨率的小块(以及不同的格式,例如iOS需要HLS)。您的客户端可以在实时数据库中存储块信息(块名称,可用分辨率,块数),并可以随着视频的进展从存储中下载这些块。


I'm working on an app that has video streaming functionality. I'm using firebase database and firebase storage. I'm trying to find some documentation on how firebase storage handles video files, but can't really find much.

There's mentioning in the docs that firebase storage works with other google app services to allow for CDN and video streaming, but all searches seem to lead to a dead end. Any advice?

解决方案

I think there are several types of video streaming, which could change our answer here:

  • Live streaming (subscribers are watching as an event happens)
  • Youtube style (post a video and end users watch at their convenience)

Having built a live streaming Periscope style app using Firebase Storage and the Firebase Realtime Database, I pretty strongly recommend against it--we uploaded three second chunks and synced them via the Realtime Database. While it worked (surprisingly well), there was ~5 second latency over very good internet, and it also wasn't the most efficient solution (after all, you're uploading and storing that video, plus there wasn't any transcoding). I recommend using some WebRTC style, built for video transport, and using the Realtime Database for signaling along side the stream.

On the other side, it's definitely possible to build mobile YT on Firebase features. The trick here is going to be transcoding the video (using something like Zencoder or Bitmovin, more here: https://cloud.google.com/solutions/media/) to chop up your uploaded video into smaller chunks of different resolutions (and different formats, iOS requires HLS for streaming, for instance). You client can store chunk information in the Realtime Database (chunk name, resolutions available, number of chunks), and can download said chunks from Storage as the video progresses.

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

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