简体   繁体   English

是否可以在Cesium中显示rtmp实时流视频?

[英]Is it possible to display rtmp live stream video in Cesium?

I would like to display an rtmp stream video in Cesium. 我想在Cesium中显示rtmp流视频。 I created an entity and used the <video> element as its material. 我创建了一个实体,并使用<video>元素作为其材料。 When I use video stored locally (in .mp4 format) it worked fine, but when I switched to an rtmp source and play it via videojs, it can play in <video> element, but it can't play on the entity. 当我使用本地存储的视频(.mp4格式)时,效果很好,但是当我切换到rtmp源并通过videojs播放时,它可以在<video>元素中播放,但不能在实体上播放。 The rtmp uses flash to play, while ordinary video does not require flash, I wonder if its because of this. rtmp使用Flash播放,而普通视频不需要Flash,我想知道是否是因为这个原因。

Here's the <video> element 这是<video>元素

<video id="rtmpStream" class="video-js" controls preload="auto" width="640" height="300" data-setup="{}" autoplay>
        <source src="rtmp://202.69.69.180:443/webcast/bshdlive-pc" type="rtmp/flv">
    </video>

I have a solution: 我有一个解决方案:

Use video server such as VLC to receive stream and resend the stream as an http link, then use nginx proxy or some other way to make sure that the newly send stream is under the same source as the cesium app, after that just load the video element (using http link as the source) in cesium like it was in the official sandbox demo. 使用视频服务器(例如VLC)接收流并将该流作为http链接重新发送,然后使用nginx代理或其他方法来确保新发送的流与铯应用程序位于同一源下,之后只需加载视频铯中的元素(使用http链接作为源),就像在官方沙盒演示中一样。 Doesn't seem to work with rtmp but works with other format. 似乎不适用于rtmp,但适用于其他格式。

It works but it seems that VLC is not very good in terms of performance. 它可以工作,但似乎VLC在性能方面不是很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM