I want to control the zoom of a smartphone camera using streamlit-webrtc

I want to control the zoom of a smartphone camera using streamlit-webrtc

If applicable, please provide the steps we should take to reproduce the error or specified behavior.

Expected behavior:

Explain what you expect to happen when you run the code above.

Actual behavior:

Explain the undesired behavior or error you see when you run the code above.
If you’re seeing an error message, share the full contents of the error message here.

Debug info

  • Streamlit version: 1.26
  • Python version: 3.10.11
  • Using PipEnv
  • OS version:Windows10 pro
  • Browser version: chrome

Requirements file

Using Conda? PipEnv? PyEnv? Pex? Share the contents of your requirements file here.
Not sure what a requirements file is? Check out this doc and add a requirements file to your app.

Links

  • Link to your GitHub repo:
  • Link to your deployed app:

Additional information

If needed, add any other context about the problem here.

Hi @Kamaboko0609

The GitHub page of the streamlit-webrtc component provides mention that the image can be processed and therefore you can apply post-processing on the image via a callback:

def video_frame_callback(frame):
    img = frame.to_ndarray(format="bgr24")
    with lock:
        img_container["img"] = img

    return frame

More info here: GitHub - whitphx/streamlit-webrtc: Real-time video and audio streams over the network, with Streamlit.

Hope this helps!

Best regards,
Chanin

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.