Search code examples
javascriptflashvideo.jscesiumjs

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


I would like to display an rtmp stream video in Cesium. I created an entity and used the <video> element as its material. 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. The rtmp uses flash to play, while ordinary video does not require flash, I wonder if its because of this.

Here's the <video> element

<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>

Solution

  • 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. Doesn't seem to work with rtmp but works with other format.

    It works but it seems that VLC is not very good in terms of performance.