imagefreeze pipeline failing with RTSPServer
I have a gstreamer pipeline that uses imagefreeze to stream frames from a PNG file. It works fine with gst-launch-1.0
:
gst-launch-1.0 -v filesrc location=test.png ! decodebin ! videoconvert ! imagefreeze ! autovideosink
However when I run with gst-rtsp-server (using Python bindings) the stream is not working:
import sys
import gi
gi.require_version("Gst", "1.0")
gi.require_version("GstRtspServer", "1.0")
from gi.repository import Gst, GstRtspServer, GLib
PIPELINE = f"filesrc location=test.png ! pngdec ! videoconvert ! imagefreeze ! autovideosink"
class MediaFactory(GstRtspServer.RTSPMediaFactory):
def do_create_element(self, _url):
return Gst.parse_launch(PIPELINE)
def run_server():
server = GstRtspServer.RTSPServer()
factory = MediaFactory()
factory.set_shared(True)
server.get_mount_points().add_factory("/stream", factory)
server.attach(None)
if __name__ == "__main__":
Gst.init(None)
run_server()
GLib.MainLoop().run()
When I run with GST_DEBUG=2 python test.py
and hit the endpoint with vlc rtsp://127.0.0.1:8554/stream
, I get the following error:
1:04:19.631279626 4187713 0x55c27bebb460 ERROR rtspclient rtsp-client.c:3017:handle_setup_request: client 0x55c27bec43b0: no control in path '/stream'
The below test pipeline works fine in the Python script, so it makes me wonder if there's an issue with RTSPServer and my imagefreeze pipeline, or maybe something to do with my environment.
videotestsrc ! video/x-raw,width=1920,height=1080 ! x264enc ! h264parse ! rtph264pay name=pay0 config-interval=1
My environment:
- Ubuntu 20.10
- gst-rtsp-server 1.18.0-2
- PyGObject==3.38.0
- gobject==0.1.0
- Linux Kernel: 5.9.8
Edit: I've also reproduced this on MacOS Catalina.