Delete pages/9_sendonly_video.py
Browse files- pages/9_sendonly_video.py +0 -36
pages/9_sendonly_video.py
DELETED
@@ -1,36 +0,0 @@
|
|
1 |
-
"""A sample to use WebRTC in sendonly mode to transfer frames
|
2 |
-
from the browser to the server and to render frames via `st.image`."""
|
3 |
-
|
4 |
-
import logging
|
5 |
-
import queue
|
6 |
-
|
7 |
-
import streamlit as st
|
8 |
-
from streamlit_webrtc import WebRtcMode, webrtc_streamer
|
9 |
-
|
10 |
-
from sample_utils.turn import get_ice_servers
|
11 |
-
|
12 |
-
logger = logging.getLogger(__name__)
|
13 |
-
|
14 |
-
|
15 |
-
webrtc_ctx = webrtc_streamer(
|
16 |
-
key="video-sendonly",
|
17 |
-
mode=WebRtcMode.SENDONLY,
|
18 |
-
rtc_configuration={"iceServers": get_ice_servers()},
|
19 |
-
media_stream_constraints={"video": True},
|
20 |
-
)
|
21 |
-
|
22 |
-
image_place = st.empty()
|
23 |
-
|
24 |
-
while True:
|
25 |
-
if webrtc_ctx.video_receiver:
|
26 |
-
try:
|
27 |
-
video_frame = webrtc_ctx.video_receiver.get_frame(timeout=1)
|
28 |
-
except queue.Empty:
|
29 |
-
logger.warning("Queue is empty. Abort.")
|
30 |
-
break
|
31 |
-
|
32 |
-
img_rgb = video_frame.to_ndarray(format="rgb24")
|
33 |
-
image_place.image(img_rgb)
|
34 |
-
else:
|
35 |
-
logger.warning("AudioReciver is not set. Abort.")
|
36 |
-
break
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|