I’m attempting to stream a Freedesktop ScreenCast capture over WebRTC via GStreamer using its pipewiresrc
and webrtcbin
elements.
I’ve made a decent amount of progress so far: I can stream the videotestsrc
with my current configuration, and I can also stream a screen capture when using the higher level webrtcsink
element. Finally, when I run my current configuration with the pipewiresrc
, I do actually get some stream data: usually I only get the first frame before the stream freezes, but very occasionally, seemingly at random, do I get a very slow, very choppy stream.
Here’s my current GStreamer pipeline:
pipewiresrc path={self.pipewire_node_id} do-timestamp=true
! videoconvert
! videoscale
! videorate
! video/x-raw,format=I420,width=2560,height=1600,framerate=30/1
! vp8enc
! rtpvp8pay pt=96 mtu=1200
! application/x-rtp,media=video,encoding-name=VP8,payload=96
! webrtcbin name=webrtc stun-server=stun://stun.l.google.com:19302
And here’s the GStreamer debug output when I run my code at log level 2:
0:00:04.468006339 3556 0x7992ec000db0 WARN GST_PADS gstpad.c:4392:gst_pad_peer_query:<nicesrc0:src> could not send sticky events
0:00:05.388609402 3556 0x7992ec000b70 WARN rtprtxsend gstrtprtxsend.c:942:gst_rtp_rtx_send_sink_event:<rtprtxsend0> Payload 96 not in rtx-pt-map
0:00:05.388847235 3556 0x7992ec000b70 WARN rtpsession gstrtpsession.c:2484:gst_rtp_session_chain_send_rtp_common:<rtpsession0> Can't determine running time for this packet without knowing configured latency
I’m thinking it’s a timing related thing since depending on how I tweak my pipeline I get various timing related errors, but I’m new to GStreamer so that’s just an intuition.
I’m running all of this with Python via PyGObject. I’ve tried just about everything I can imagine, or find online, so please feel free to ask for more information.