SS8297 commited on
Commit
c46e0ec
·
1 Parent(s): a78c7ed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -0
app.py CHANGED
@@ -1,6 +1,19 @@
1
  import cv2
2
  import streamlit as st
3
  import time
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
  st.title("webcam live feed")
6
  run = st.toggle('Start Webcam')
 
1
  import cv2
2
  import streamlit as st
3
  import time
4
+ from streamlit_webrtc import webrtc_streamer, WebRtcMode, RTCConfiguration
5
+
6
+ RTC_CONFIGURATION = RTCConfiguration(
7
+ {"iceServers": [{"urls": ["stun:stun.l.google.com:19302"]}]}
8
+ )
9
+
10
+ webrtc_ctx = webrtc_streamer(
11
+ key="WYH",
12
+ mode=WebRtcMode.SENDRECV,
13
+ rtc_configuration=RTC_CONFIGURATION,
14
+ media_stream_constraints={"video": True, "audio": False},
15
+ async_processing=False,
16
+ )
17
 
18
  st.title("webcam live feed")
19
  run = st.toggle('Start Webcam')