blackary / streamlit-camera-input-live

Alternative version of st.camera_input which returns the webcam images live, without any button press needed
MIT License
31 stars 10 forks source link

Output live #4

Closed tobibaum closed 1 year ago

tobibaum commented 1 year ago

Hey there. do you have any ideas how to do the opposite? i.e. only stream live data out without any webcam input? that live data is for example constructed with some opencv operations?!

blackary commented 1 year ago

You could do something like this, where you create a container to hold the image, and then update the contents of a container in a loop.

https://discuss.streamlit.io/t/maintain-and-update-a-single-chart/47512/2?u=blackary

tobibaum commented 1 year ago

thanks for your quick answer!! i've been trying that implementation. the problem is, that streamlit itself does not love the while true parts of this solution. using a VPN to connect between your own and a remote device somehow leads to complications. for anyone facing similar problems: I solved my usecase using this demo: https://github.com/whitphx/streamlit-webrtc-example/blob/main/pages/8_media_files_streaming.py

tobibaum commented 1 year ago

closed

blackary commented 1 year ago

Oh yeah, streamlit-webrtc is a great idea