I am working on a real-time video streaming project using WebRTC. Our setup has a Video Stream Sender (mobile robot) and a Video Stream Receiver (robot controller) with a Signaling Server for SDP negotiation in between. The robot and the robot controller are directly connected via Wi-Fi. When both devices are using Wi-Fi, streaming works seamlessly, but faces challenges when transitioning between Wi-Fi and 4G networks.
How can I handle SDP negotiation to smoothly transition sessions from Wi-Fi to 4G without interrupting the video stream? Are there any best practices or specific WebRTC features that we should leverage to make this transition as seamless as possible?
I have made a mermaid syntax sequence diagram however I think it is wrong therefore I have little knowledge of networking.
sequenceDiagram
participant VSS as Video Stream Sender
participant SS as Signaling Server
participant VSR as Video Stream Receiver
Note over VSS,VSR: Wi-Fi RTP Streaming
VSS->>VSR: Wi-Fi Deterioration Detected
VSR->>VSS: Acknowledge Wi-Fi Deterioration
Note over VSS,VSR: Start taking over session information
Note over VSS: Connect to 4G line
Note over VSR: Connect to 4G line
VSS->>SS: SIP INVITE? (send SDP for RTP streaming, when to receive or send webRTC information? Unclear whether to receive from server or to send from terminal to server)
SS->>VSS: SIP 200 OK
SS->>VSR: SIP INVITE
VSR->>SS: SIP 200 OK
Note over VSS: Generate SDP for Offer
VSS->>SS: Offer (4G)
SS->>VSR: Forward Offer
Note over VSR: Register SDP for Offer
Note over VSR: Create SDP for Answer
VSR->>SS: Answer (4G)
SS->>VSS: Forward Answer
Note over VSS: Register SDP for Answer
VSS->>VSR: Exchange SDP and ICE candidate
Note over VSS,VSR: Session Information Transferred
Note over VSS,VS
I am looking for insights, recommendations, and code examples to help me effectively address this challenge. What areas of basic knowledge do I need to study in order to proceed with this project? Best regards.
I solved this problem myself: It was possible by using SIP invite for WebRTC signaling and passing SDP information.