Search code examples
video-streamingwebrtcrtsp

WebRTC stream to RTSP


I believe the question is fairly straight forward in the title. I have the WebRTC stream however my end program consume RTSP streams. Is there a simple way to convert the stream from WebRTC to RTSP?

There is no latency requirement.


Solution

  • You can probably reduce some of the indirection, but I would use rtp-forwarder to take WebRTC -> RTP.

    You can then push these via ffmpeg into an RTSP server! The README.md shows how to playback the media directly. Instead just push using ffmpeg into your RTSP server. ffmpeg -i rtp-forwarder.sdp -protocol_whitelist file,udp -f rtsp -rtsp_transport tcp rtsp://$RTSP_SERVER:8888/live.sdp