diff --git a/src/lib/stream/sink/rtsp_sink.rs b/src/lib/stream/sink/rtsp_sink.rs index 91843b92..84cac019 100644 --- a/src/lib/stream/sink/rtsp_sink.rs +++ b/src/lib/stream/sink/rtsp_sink.rs @@ -248,7 +248,15 @@ impl RtspSink { "Failed to find RTSP compatible address. Example: \"rtsp://0.0.0.0:8554/test\"", )?; - let socket_path = format!("/tmp/{id}"); + let socket_path = { + let path = std::env::temp_dir().join(format!("{id}.sock")); + + if path.try_exists()? { + std::fs::remove_file(path.clone())?; + } + path.to_string_lossy().to_string() + }; + let sink = gst::ElementFactory::make("shmsink") .property_from_str("socket-path", &socket_path) .property("sync", false)