Streamlit Camera Input Live

0.2.0 · active · verified Thu Apr 16

Streamlit Camera Input Live is an alternative version of Streamlit's built-in `st.camera_input` component. Unlike the standard version, it returns webcam images live without requiring a button press, making it suitable for real-time preview applications. The current version is 0.2.0, with an infrequent release cadence, having last been updated in September 2022.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to embed a live camera feed into a Streamlit application. It uses `camera_input_live` to continuously capture frames and displays them using `st.image`. A checkbox is included to toggle the visibility of camera controls.

import streamlit as st
from streamlit_camera_input_live import camera_input_live

st.set_page_config(layout="centered")
st.title("Streamlit Live Camera Input Demo")

st.write("### See a new image every second")
controls = st.checkbox("Show camera controls", value=True)
image = camera_input_live(show_controls=controls, key="my_camera_input")

if image is not None:
    st.image(image, caption="Live Camera Feed", use_column_width=True)
    st.success("Image received live!")
else:
    st.info("Waiting for camera input...")

view raw JSON →