I wrote a WebRTC server and tested it using a WebRTC client on Edge, playing through the WHEP protocol. The SDP exchange for media information is working correctly, as are the STUN and DTLS handshakes, with no issues. I use libsrtp to encrypt and decrypt RTP packets.
The problem is that now I cannot play H264 video. I checked the edge://webrtc-internals
page and looked at the video tag’s Stats graphs for inbound-rtp (kind=video, mid=1, ssrc=2124085007, id=IT01V2124085007). Data is being received, but it is not being decoded. The WebRTC client keeps reporting a 201 error, PLI, and missing I-frames.
I even wrote my own WebRTC client to test it. It goes through WHEP -> SDP -> STUN -> DTLS -> libsrtp (unprotocol) -> RTP to unpack H264, and then writes it to a file, which I play using VLC. I found that H264 plays normally. I’ve also tested this client with other WebRTC servers, and there are no issues.
I captured the packets using Wireshark and saw that the SRTP sequence number, timestamp, SSRC, and PT are all correct
I really don’t know how to debug this or find the cause of the issue. Where could the problem be? I’m completely out of ideas. Why isn’t the WebRTC client decoding and keeps telling me that I’m missing I-frames? My sent data packets do contain I-frames, but they might not be the initial I-frame. Does anyone know what could be going on?