camerartsp / app.py
Mauricio A. Guerta
Programa exemplo rtsp
8d3c246
raw
history blame
641 Bytes
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)