Camera is not switched on for webrtc

The camera is not able to switch on for webrtc when clicking Start.

Below is the error:

2023-02-07 02:59:00.887 Track audio received
2023-02-07 02:59:00.887 Add a track <aiortc.rtcrtpreceiver.RemoteStreamTrack object at 0x7f16cb0119a0> of kind audio to <aiortc.rtcpeerconnection.RTCPeerConnection object at 0x7f16cafab370>
2023-02-07 02:59:00.888 Track video received
2023-02-07 02:59:00.888 Set <aiortc.rtcrtpreceiver.RemoteStreamTrack object at 0x7f16cb1d07c0> as an input video track with video_processor <class 'streamlit_webrtc.process.AsyncVideoProcessTrack'>
2023-02-07 02:59:00.888 Add a track <streamlit_webrtc.process.AsyncVideoProcessTrack object at 0x7f1614564040> of kind video to <aiortc.rtcpeerconnection.RTCPeerConnection object at 0x7f16cafab370>
2023-02-07 02:59:00.914 Connection(10) Check CandidatePair(('10.12.0.19', 46705) -> ('192.168.100.6', 60250)) State.FROZEN -> State.WAITING
2023-02-07 02:59:00.914 ICE connection state is checking
2023-02-07 02:59:00.914 Connection(10) Check CandidatePair(('10.12.0.19', 46705) -> ('192.168.100.6', 60250)) State.WAITING -> State.IN_PROGRESS
2023-02-07 02:59:16.821 ICE connection state is closed
2023-02-07 02:59:32.634 Exception in callback Transaction.__retry()
handle: <TimerHandle when=2274713.346668958 Transaction.__retry()>
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/asyncio/selector_events.py", line 1048, in sendto
    self._sock.sendto(data, addr)
AttributeError: 'NoneType' object has no attribute 'sendto'
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "/home/appuser/venv/lib/python3.8/site-packages/aioice/stun.py", line 309, in __retry

    self.__protocol.send_stun(self.__request, self.__addr)

  File "/home/appuser/venv/lib/python3.8/site-packages/aioice/ice.py", line 243, in send_stun
    self.transport.sendto(bytes(message), addr)
  File "/usr/local/lib/python3.8/asyncio/selector_events.py", line 1058, in sendto
    self._fatal_error(
  File "/usr/local/lib/python3.8/asyncio/selector_events.py", line 705, in _fatal_error
    self._loop.call_exception_handler({
AttributeError: 'NoneType' object has no attribute 'call_exception_handler'

Github link: GitHub - hellojr01/facial-expressions-recognition-system
Streamlit app: https://hellojr01-facial-expressions-recognition-system-app-ct02kz.streamlit.app/

I am also facing the same problem.
Is there any progress?

I am also facing the same issue, same error. STUN server failed, changed to TURN server, it work, 1-2 days later, it will fail. Have posted my issues here,
Inconsistent issue with streamlit-webrtc and streamlit.

Perhaps you should too…
Original component - is also not working https://webrtc.streamlit.app/

strange that ppl are ignoring this issue…This is so unstable.

1 Like

I’m also encountering the same error. Have you guys found any solution?

I’m have the same error. Running the app in ec2, aws, using https (443).

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.