Inconsistent issue with streamlit-webrtc and streamlit

Hi, I have been struggling with the streamlit-webrtc component for the past 2-3 weeks. Before you write me off and ask me to go check with the component’s author here - whitphx, please hear me out.

I deployed a streamlit+webrtc app 2 weeks ago referencing component from whitphx - using google’s stun server “” and it works fine.
Few days later, my streamlit app went down and webrtc component failed - I can’t view live video.
The original author’s app also failed.

Then 2 days ago, I finally manage to get the webrtc component to work (with some latency issue) after I switched to a TURN server . But today, it stop working again.

On both occasion when i change STUN/ TURN servers, I tested it on Trickle ICE site and it works fine.
But on streamlit - the pattern I see here is that - it works one day and 1-2 days later, it fails. This is inconsistent and I am sure it has nothing to do with the component’s library.

the original author’s app has been working fine until 2 weeks ago, I have not much knowledge on network or webrtc, but I am trying like hell to figure out what is going on.

These are my tests on TrickleICE and Streamlit on 3 different browsers using my ISP 4G network (no WIFI to rule out any blocking).

Browser: Chrome.111.0…64
TrickleICE: stun server: fail | turn server: fail
Streamlit: fail (screenshot attached)

Browser: Safari.16.3
TrickleICE: stun server: ok | turn server: ok
Streamlit: fail. (screenshot attached)

Browser: Firefox. 111.0
TrickleICE: stun server: ok | turn server: ok
Streamlit: fail (screenshot attached)

Besides possible;

  • network issues (test using 4G only),
  • browser issues (TrickleICE test on STUN/ TURN servers works on Firefox and Safari, but streamlit+webrtc app fail in the same browsers)
  • version issues: I am using. streamlit==1.19.0 and streamlit_webrtc==0.45.0

Is there by any chance - Streamlit’s cloud network have some settings that is screwing up the webrtc connections? Or can someone please help look into this or point me in the right direction? Thanks in advance.


I have the same issue. I am unable to even run the author’s deepspeech model on streamlit cloud since last night. I tried everything but something seems to be wrong.

Hi, thank you for the report and sorry for my long off.

As I posted in the discussion at Inconsistent issue with streamlit-webrtc in streamlit app · Issue #1213 · whitphx/streamlit-webrtc · GitHub,
I fixed this problem on with TURN servers from the Twilio service. While it’s a free tier and there is a cap to the total payload, anyway it’s working at this point.

I also updated the relevant section in as GitHub - whitphx/streamlit-webrtc: Real-time video and audio streams over the network, with Streamlit.. So please check it and let me know if there are something wrong or unclear.

Thank you.