webrtc icon indicating copy to clipboard operation
webrtc copied to clipboard

How to deal packet loss?

Open ChenMoGe2 opened this issue 3 years ago • 3 comments

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

ChenMoGe2 avatar Aug 04 '22 12:08 ChenMoGe2

Hi @ChenMoGe2 I'm having the same issue, were you able to solve it?

rajivg91 avatar Oct 24 '22 22:10 rajivg91

please take a look at https://github.com/pion/webrtc/discussions/2254

alexpokotilo avatar Oct 25 '22 06:10 alexpokotilo

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.

Tekunalogy avatar Jun 01 '23 20:06 Tekunalogy