<div dir="ltr">Hello all and happy new year !<div><br></div><div>I have recently started creating gstreamer pipelines, so apologies if I'm missing something obvious.</div><div>I am trying to configure a raspberry pi 4 with the v1.2 camera and a cheap USB microphone to act as a webrtc peer. In my scenario, the raspberry will be the only peer sending audio/video, the other peer will only act only as receiver.</div><div><br></div><div>To integrate webrtc and gstreamer I'm using this example as base:</div><div><a href="https://github.com/awslabs/amazon-kinesis-video-streams-webrtc-sdk-c/blob/master/samples/kvsWebRTCClientMasterGstreamerSample.c">https://github.com/awslabs/amazon-kinesis-video-streams-webrtc-sdk-c/blob/master/samples/kvsWebRTCClientMasterGstreamerSample.c</a><br></div><div>I don't mind sharing the actual code I'm using but I think it will be easier to reproduce this way.</div><div><br></div><div>I have tested several configurations for the pipeline; my main goal is to achieve the lowest latency possible with a reasonable bandwidth, I don't mind having a low-quality output.</div><div><br></div><div>Currently, the best I have managed to configure is this:</div><div><br></div><div>"v4l2src do-timestamp=TRUE device=\"/dev/video0\" ! videoflip method=rotate-180 ! queue ! videoconvert ! "<br>"video/x-raw,format=I420,width=640,height=480,framerate=25/1 ! "<br>"omxh264enc control-rate=1 target-bitrate=500000 periodicty-idr=25 inline-header=FALSE ! "<br>"h264parse config-interval=-1 ! "<br>"video/x-h264,stream-format=byte-stream,alignment=au,width=640,height=480,framerate=25/1,profile=baseline ! "<br>"appsink sync=TRUE emit-signals=TRUE name=appsink-video "<br>"alsasrc use-driver-timestamps=FALSE device=plughw:1 ! queue max-size-buffers=1 ! opusenc ! "<br>"audio/x-opus ! appsink max-buffers=2 drop=true sync=TRUE emit-signals=TRUE name=appsink-audio"<br></div><div><br></div><div>With this pipeline, audio and video start synchronized and with low latency but after a while, around 2 minutes, "something" happens and audio starts getting more and more out of sync with the video. Video keeps showing with low latency in all my tests with this configuration. In the chrome webrtc stats it's easy to see when the audio lag starts to degrade (blue arrow)</div><div><img src="cid:ii_lcf5dvf10" alt="image.png" width="562" height="377"><br></div><div><br></div><div> I don't know exactly what is the problem, these tests have been executed in my office, with good WiFi coverage and without using TURN. When playing the CPU cores are below 25% so it doesn't look to be overloaded either</div><div><br></div><div>Thank you very much,</div><div>Carlos</div><div><br></div></div>