{"id":7763,"library":"streamlit-camera-input-live","title":"Streamlit Camera Input Live","description":"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.","status":"active","version":"0.2.0","language":"en","source_language":"en","source_url":"https://github.com/blackary/streamlit-camera-input-live","tags":["streamlit","camera","webcam","live-feed","image-processing","component"],"install":[{"cmd":"pip install streamlit-camera-input-live","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"symbol":"camera_input_live","correct":"from streamlit_camera_input_live import camera_input_live"}],"quickstart":{"code":"import streamlit as st\nfrom streamlit_camera_input_live import camera_input_live\n\nst.set_page_config(layout=\"centered\")\nst.title(\"Streamlit Live Camera Input Demo\")\n\nst.write(\"### See a new image every second\")\ncontrols = st.checkbox(\"Show camera controls\", value=True)\nimage = camera_input_live(show_controls=controls, key=\"my_camera_input\")\n\nif image is not None:\n    st.image(image, caption=\"Live Camera Feed\", use_column_width=True)\n    st.success(\"Image received live!\")\nelse:\n    st.info(\"Waiting for camera input...\")","lang":"python","description":"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."},"warnings":[{"fix":"Review the function signature and update argument names to use standard Python snake_case (e.g., `show_controls`).","message":"Version 0.2.0 standardized argument casing, which may break older code relying on different case conventions for parameters. For example, `show_controls` might have been `showControls` in prior versions.","severity":"breaking","affected_versions":"<=0.1.0"},{"fix":"For basic live previews, adjust the `debounce` parameter (e.g., `debounce=100` for 100ms updates). For advanced, high-performance real-time applications, consider using `streamlit-webrtc`.","message":"This component prioritizes simplicity over raw performance and may be noticeably slower for high-frame-rate, real-time video processing compared to alternatives like `streamlit-webrtc`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"There is no direct fix within the component itself. If back camera access is critical, more advanced Streamlit components or custom JavaScript might be required, or using `streamlit-webrtc` which often offers more granular camera controls.","message":"The component does not natively support selecting the back camera on mobile devices, defaulting to the front camera.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Increase the update frequency by setting the `debounce` parameter to a lower value, e.g., `camera_input_live(debounce=100)`. For very demanding real-time scenarios, `streamlit-webrtc` might be a better fit.","cause":"The component's default update rate (`debounce=1000ms`) is set for simplicity. High network latency or browser issues can also contribute to freezing.","error":"Camera works extremely slow. Sometimes it doesn't work at all (it freezes)."},{"fix":"This feature is not available out-of-the-box. Developers needing this functionality may need to explore browser-specific camera selection APIs via custom Streamlit components or use more comprehensive real-time video libraries like `streamlit-webrtc` which might provide more control.","cause":"The `streamlit-camera-input-live` component currently does not offer a direct parameter to specify which camera (front or back) to use.","error":"How to switch to the back camera on mobile devices?"}]}