0

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>
John_Doe
  • 37
  • 1
  • 7
  • Yes. Use HLS not RTMP. Find the HLS (m3u8) version of the same broadcast as that RTMP link. For your link you can try `http://202.69.67.66:443/webcast/bshdlive-pc/playlist.m3u8` or even also `http://202.69.67.66:443/webcast/bshdlive-mobile/playlist.m3u8` but it won't work because you chose a link that is protected from outsider http requests. I think you have to share or use their own player. – VC.One Aug 16 '19 at 19:41

1 Answers1

1

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.

John_Doe
  • 37
  • 1
  • 7