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