Skip to content

Commit

Permalink
fixed issue with rtsp channel
Browse files Browse the repository at this point in the history
  • Loading branch information
naseemap47 committed Feb 22, 2023
1 parent 76e7742 commit 1ef1278
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,17 +134,8 @@
'RTSP URL:',
'eg: rtsp://admin:[email protected]/cam/realmonitor?channel=0&subtype=0'
)
# st.sidebar.markdown('Press Enter after pasting RTSP URL')
url = rtsp_url[:-11]
rtsp_options = st.sidebar.selectbox(
'RTSP Channel',
('Select Channel', '0', '1', '2', '3',
'4', '5', '6', '7', '8', '9', '10')
)

if not rtsp_options == 'Select Channel':
pred = st.checkbox(f'Predict Using {model_type}')
cap = cv2.VideoCapture(f'{url}{rtsp_options}&subtype=0')
pred = st.checkbox(f'Predict Using {model_type}')
cap = cv2.VideoCapture(rtsp_url)


if (cap != None) and pred:
Expand All @@ -155,7 +146,7 @@
success, img = cap.read()
if not success:
st.error(
f'RSTP channel {rtsp_options} NOT working\nChange channel or Connect properly!!',
f"{options} NOT working\nCheck {options} properly!!",
icon="🚨"
)
break
Expand Down

0 comments on commit 1ef1278

Please sign in to comment.