From fcfec4b6a93228e1f261292b8dd36cb5a4cf01cd Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Sat, 2 Aug 2025 00:00:39 +0200 Subject: [PATCH] Use MJPG stream instead of RTSP as the webcams already produce MJPG, it wouldn't make sense to re-encode the stream. --- streamlit_app.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/streamlit_app.py b/streamlit_app.py index 6b446db..9723cb3 100644 --- a/streamlit_app.py +++ b/streamlit_app.py @@ -21,15 +21,13 @@ if "prom" not in st.session_state: st.set_page_config(layout="wide", page_title="People Counter") -# RTSP-Stream URL -#RTSP_URL = st.text_input("RTSP Stream URL", "rtsp://:@:/pfad") -RTSP_URL = "rtsp://localhost:8554/cam" +STREAM_URL = "http://192.168.11.76:8080?action=stream" start_button = st.button("Start Counter") FRAME_SKIP = 2 # Reduziert Verarbeitungslast -if start_button and RTSP_URL: +if start_button and STREAM_URL: line_orientation = 'vertical' line_position = 640 @@ -37,7 +35,7 @@ if start_button and RTSP_URL: model = YOLO("yolo_weights/yolo11n.pt") counter = Counter(line_orientation) - cap = cv2.VideoCapture(RTSP_URL) + cap = cv2.VideoCapture(STREAM_URL) frame_idx = 0 while cap.isOpened():