Access Webcam Video from a hosted Streamlit application

I think that when the app runs on a remote host, establishing the connection takes longer time and webrtc_ctx.video_receiver.get_frame(timeout=1) throws queue.Empty error because of timeout.

However, your code linked above already wraps this line with try-except and the error is caught for the loop to continue. Then current code looks able to work. Isn’t it?

Even so, if you want to avoid the error, please try setting the timeout longer.