Spaces:
Runtime error
Runtime error
Mauricio A. Guerta
commited on
Commit
·
8d3c246
1
Parent(s):
929496a
Programa exemplo rtsp
Browse files
app.py
CHANGED
@@ -1,4 +1,22 @@
|
|
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
|
3 |
-
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
i#### IMPORT #####
|
2 |
+
import cv2
|
3 |
+
import time
|
4 |
import streamlit as st
|
5 |
|
6 |
+
### CONNECT TO CAMERA
|
7 |
+
# either like this using your own camera IP
|
8 |
+
capture = cv2.VideoCapture('rtsp://192.168.0.131:554/user=atualli&password=Ope1w3r&channel=1&stream=0.sdp')
|
9 |
+
# or like this
|
10 |
+
capture = cv2.VideoCapture('rtsp://192.168.0.131:554/user=atualli&password=Ope1w3r&channel=1&stream=0.sdp')
|
11 |
+
|
12 |
+
### Check box to turn on camera
|
13 |
+
run = st.checkbox("Turn on camera",value=False)
|
14 |
+
|
15 |
+
### MAKE PLACE HOLDER FOR VIDEO FRAMES
|
16 |
+
FRAME_WINDOW =st.image([])
|
17 |
+
|
18 |
+
### GRAB NEW IMAGE
|
19 |
+
if run:
|
20 |
+
x, frame = camera.read()
|
21 |
+
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
|
22 |
+
time.sleep(0.025)
|