Closed nicolalandro closed 2 years ago
I solved it by adding RTC config:
from streamlit_webrtc import webrtc_streamer, WebRtcMode, RTCConfiguration
RTC_CONFIGURATION = RTCConfiguration(
{"iceServers": [{"urls": ["stun:stun.l.google.com:19302"]}]}
)
webrtc_ctx = webrtc_streamer(
key="WYH",
mode=WebRtcMode.SENDRECV,
rtc_configuration=RTC_CONFIGURATION,
media_stream_constraints={"video": True, "audio": False},
async_processing=False,
)
What exactly do this configuration?
This article section would be an entry point for this topic.
Python WebRTC basics with aiortc may also helps to understand WebRTC basics and what this extension is doing.
For more details, please google the keyword such as "WebRTC STUN server". You will find articles like https://www.3cx.com/pbx/what-is-a-stun-server/.
I run streamlit on a server at 127.0.0.1 and after I bind it in local via ssh, streamlit work good, also if I select the webcam I can see the preview correctly but when I click start It does not work. Maybe that issue can be related to camera not working on hosted streamlit site?
My python error log is the following:
And into the browser I can see: