webrtc
webrtc copied to clipboard
How to deal packet loss?
I use pion webrtc to develop a media server and the video quality is low(I use simulcast) and video loss frame frequently.I send rtcp from server to client using below code in example/simulcast:
// Start reading from all the streams and sending them to the related output track
rid := track.RID()
go func() {
ticker := time.NewTicker(3 * time.Second)
for range ticker.C {
fmt.Printf("Sending pli for stream with rid: %q, ssrc: %d\n", track.RID(), track.SSRC())
if writeErr := peerConnection.WriteRTCP([]rtcp.Packet{&rtcp.PictureLossIndication{MediaSSRC: uint32(track.SSRC())}}); writeErr != nil {
fmt.Println(writeErr)
}
}
}()
but the video quality still low and the packet still loss(increment by I doing nothing) How can I sovle it and I have two question. 1.Is there some perfect example or project to deal with packet loss. 2.How can I deal Rtcp packet from sender(client).If I must handle rtcp packets in code or the pion can handle it automaticly Thank you
Hi @ChenMoGe2 I'm having the same issue, were you able to solve it?
please take a look at https://github.com/pion/webrtc/discussions/2254
Running into severe packet loss on windows 10/11 with this example (rtp-to-webrtc): https://github.com/pion/webrtc/tree/master/examples/rtp-to-webrtc
however, no issues with the same code on ubuntu 22. Same machine specs, same router/network conditions.