[Python] Obsbot Tiny 2 in gradio Image component can not take a snapshot

Discussão em 'Python' iniciado por Stack, Outubro 5, 2024.

  1. Stack

    Stack Membro Participativo

    I want to display the live stream of my Obsbot Tiny 2 webcam in a gradio 4.44.1 (or 5.0.0b6) Image component. Additionally, I want to use python-osc 1.9.0 to send commands to the controlling OBSBOT Center v2.0.10.10, especially the "take snapshot" command. The cam's firmware version is 6.0.9.1, which offers 2 modes:

    1. the OBSBOT Tiny 2 Stream Camera, and the
    2. OBSBOT Virtual Camera

    Snapshots can only be taken with OSC command if the camera is in mode 2. Unfortunately, with gradio I only get the live stream from the camera, if the camera is in mode 1 (otherwise the Image component shows a kind of not available image).

    Can anyone please give me a hint, how to get the Tiny 2 with gradio streaming in OBSBot Virtual Camera Mode? The code I use is

    import gradio as gr
    with gr.Blocks() as demo:
    cam = gr.Image(sources=["webcam"], streaming=True, interactive=True)
    demo.launch() # in Chrome v129.0.6668.90

    Continue reading...

Compartilhe esta Página