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

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

问题描述

我正在开发一款具有视频流功能的应用.我正在使用 firebase 数据库和 firebase 存储.我试图找到一些关于 firebase 存储如何处理视频文件的文档,但找不到太多.

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.

文档中提到 firebase 存储可与其他谷歌应用服务配合使用以支持 CDN 和视频流,但所有搜索似乎都陷入了死胡同.有什么建议吗?

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:

  • 实时流媒体(订阅者在事件发生时观看)
  • Youtube 风格(发布视频,最终用户在方便时观看)

使用 Firebase 存储和 Firebase 实时数据库构建了一个实时流式传输 Periscope 风格的应用程序后,我强烈建议不要使用它——我们上传了三秒钟的块并通过实时数据库同步它们.虽然它工作正常(出人意料地好),但在非常好的互联网上有大约 5 秒的延迟,而且它也不是最有效的解决方案(毕竟,您正在上传和存储该视频,而且没有任何转码).我建议使用一些 WebRTC 样式,专为视频传输而构建,并使用实时数据库沿流发送信号.

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.

另一方面,绝对可以在 Firebase 功能上构建移动 YT.这里的技巧是对视频进行转码(使用 Zencoder 或 Bitmovin 之类的东西,更多信息请访问:https://cloud.google.com/solutions/media/) 将您上传的视频分成不同分辨率的小块(例如,iOS 需要 HLS 进行流式传输).您的客户端可以在实时数据库中存储块信息(块名称、可用分辨率、块数),并且可以随着视频的播放从存储中下载所述块.

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