Ubuntu 22.04 + gstreamer 1.20.3 python thread disappears into playing and never returns
Describe your issue
I have been struggling with an issue with Ubuntu 22.04 / Python 3.10 / gstreamer 1.20.3 (from the jammy repos) in which I launch my pipeline with this launch string
rtspsrc location=rtsp://source_url latency=0 protocols=tcp \
! queue ! rtph264depay ! h264parse \
! avdec_h264 ! videorate ! videoconvert ! video/x-raw, format=BGR, framerate=20/1 ! appsink drop=false max-buffers=0
If I launch this with gst-launch-1.0
it functions correctly, but if I launch this from my python code with the python bindings, the python thread enters the self._pipeline.set_state(Gst.State.PLAYING)
but never returns and my service freezes at that point. I cranked up the logging but the last logs I see are
d:<rtph264depay0> notifying about state-changed PAUSED to PLAYING (VOID_PENDING pending)
0:00:01.618425945 49329 0x563a63025960 INFO GST_STATES gstbin.c:2928:gst_bin_change_state_func:<pipeline0> child 'rtph264depay0' changed state to 4(PLAYING) successfully
0:00:01.618542637 49329 0x563a63025960 INFO GST_STATES gstelement.c:2806:gst_element_continue_state:<rtspsrc0> completed state change to PLAYING
0:00:01.618549077 49329 0x563a63025960 INFO GST_STATES gstelement.c:2706:_priv_gst_element_state_changed:<rtspsrc0> notifying about state-changed PAUSED to PLAYING (VOID_PENDING pending)
0:00:01.618558087 49329 0x563a63025960 INFO GST_STATES gstbin.c:2928:gst_bin_change_state_func:<pipeline0> child 'rtspsrc0' changed state to 4(PLAYING) successfully
DEBUG:pygst.GstPipeline:GstPipeline Pipeline state set to PLAYING
If I do a launch string like videotestsrc ! video/x-raw, format=BGR, framerate=20/1 ! appsink emit-signals=true drop=false max-buffers=0
everything works successfully in my service.
Now the really weird part is if I downgrade to Ubuntu 20.04 with Python 3.8, everything also works successfully.
I also tried different versions of Debian from buster to bullseye to bookworm, and out of those only the oldest one - buster - worked as well. It seems anything older than gstreamer 1.16 doesn't work for me and I can't seem to figure out why that would be the case since gst-launch-1.0 works successfully.
EDIT: Added more info in a comment.