Skip to content

Commit 1ef1278

Browse files
committed
fixed issue with rtsp channel
1 parent 76e7742 commit 1ef1278

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

app.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -134,17 +134,8 @@
134134
'RTSP URL:',
135135
'eg: rtsp://admin:[email protected]/cam/realmonitor?channel=0&subtype=0'
136136
)
137-
# st.sidebar.markdown('Press Enter after pasting RTSP URL')
138-
url = rtsp_url[:-11]
139-
rtsp_options = st.sidebar.selectbox(
140-
'RTSP Channel',
141-
('Select Channel', '0', '1', '2', '3',
142-
'4', '5', '6', '7', '8', '9', '10')
143-
)
144-
145-
if not rtsp_options == 'Select Channel':
146-
pred = st.checkbox(f'Predict Using {model_type}')
147-
cap = cv2.VideoCapture(f'{url}{rtsp_options}&subtype=0')
137+
pred = st.checkbox(f'Predict Using {model_type}')
138+
cap = cv2.VideoCapture(rtsp_url)
148139

149140

150141
if (cap != None) and pred:
@@ -155,7 +146,7 @@
155146
success, img = cap.read()
156147
if not success:
157148
st.error(
158-
f'RSTP channel {rtsp_options} NOT working\nChange channel or Connect properly!!',
149+
f"{options} NOT working\nCheck {options} properly!!",
159150
icon="🚨"
160151
)
161152
break

0 commit comments

Comments
 (0)