I am working on a GStreamer pipeline to handle an RTSP stream with the following requirements:
Restream the input RTSP stream to a new RTSP output.
Save frames from the input stream at a consistent rate of 2fps.
Here is my current pipeline:
rtspsrc location={self.stream_url} protocols=tcp latency=200 !
rtpjitterbuffer ! rtp{self.codec}depay ! tee name=t
t. ! queue ! rtp{self.codec}pay name=pay0 pt=96
t. ! queue ! avdec_{self.codec} ! videorate ! video/x-raw,framerate=2/1 !
videoconvert ! jpegenc ! appsink name=appsink emit-signals=true sync=false max-buffers=1 drop=true
The RTSP input stream is added to a GStreamer RTSP server for restreaming. However, I am facing an issue:
Frames are saved at 2fps only when I am viewing the output RTSP stream. If no one is viewing the output, the frames stop being saved.
I need the frame-saving process to run independently of whether the output stream is being viewed. Additionally, I would like to make the pipeline more efficient.
Are there any optimizations I can apply to improve the efficiency of this pipeline, especially considering CPU and memory usage?
Are there alternatives or better approaches to saving frames at a consistent rate without being dependent on client connections to the output RTSP stream?
Any insights or suggestions would be greatly appreciated.
Thank you!"