ant-media / Ant-Media-Server

Ant Media Server is a live streaming engine software that provides adaptive, ultra low latency streaming by using WebRTC technology with ~0.5 seconds latency. Ant Media Server is auto-scalable and it can run on-premise or on-cloud.
https://antmedia.io
Other
4.29k stars 636 forks source link

Switch stream #6669

Closed flex23sky closed 1 month ago

flex23sky commented 1 month ago

I have 3 ip cameras and i would like fast switch between stream

How to implement switch stream without (minimal) latency in webapp?

Current my implementation is not fast

useEffect(() => {
    webrtcStreamStore.play(data.streamId) // >> adaptor.play

    return () => {
      webrtcStreamStore.stop(data.streamId) // >> adaptor.stop
    }
  }, [roomId])
SelimEmre commented 1 month ago

Hi @flex23sky,

If you only have 3 IP cameras and data transfer cost is not a major concern, I would recommend playing all 3 simultaneously. You can show or hide them as needed, and switch between them using the HTML video tag to control their visibility.

burak-58 commented 1 month ago

Hi @flex23sky for the question and @SelimEmre for the contribution.

@flex23sky can you give more info for the scenario? Are you playing with WebRTC or HLS? If it is WebRTC you may check multitrack playback.

Also let me convert this to a github discussions.