Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regarding support for multiple webcams #10337

Open
1 task done
Anonyame opened this issue Jan 12, 2025 · 7 comments
Open
1 task done

Regarding support for multiple webcams #10337

Anonyame opened this issue Jan 12, 2025 · 7 comments

Comments

@Anonyame
Copy link

Anonyame commented Jan 12, 2025

  • I have searched to see if a similar issue already exists.

Is your feature request related to a problem? Please describe.
I encountered the image.no_webcam_support issue when trying out examples provided in the documentation during my recent project using Gradio. After reviewing some previously reported Issues, I found that this problem seems to commonly occur on computers with more than one webcam installed. My phone has both a front and rear camera, which can be detected and opened by webcamtests.com. When deploying Gradio within a local network and accessing it from my phone, the image.no_webcam_support issue consistently reoccurs.

Ref:
#10143 (This issue has not explained the cause of the problem, but the question it raises is the same as mine.)
#10049 (This issue was resolved by uninstalling OBS to remove the OBS Virtual Camera.)
#7223 (This issue is marked as similar to #7021. No resolution measures are mentioned.)
#7021 (This issue mentions that the cause of the problem is also OBS Virtual Camera.)

Describe the solution you'd like
I would like to use this opportunity to propose a Feature Request for developers to address what appears to be an issue caused by multiple webcams. Thank you!

Additional context
The used code:
File app.py:

import gradio
import gr_util
demo=gradio.Interface(
    gr_util.flip,
    gradio.Image(sources=["webcam"], streaming=True),
    "image",
    live=True
)
demo.launch(server_name="0.0.0.0")

File gr_util.py:

import numpy
def flip(im):
    return numpy.flipud(im)

Starts by executing python app.py.
The situation on the webpage:
image

@abidlabs
Copy link
Member

Hi @Anonyame multiple webcams are supported in Gradio with the option to switch between them. But the issue may be related to this:

When deploying Gradio within a local network and accessing it from my phone, the image.no_webcam_support issue consistently reoccurs

Does this issue also happen when you create a share link with Gradio (share=True in launch()) and access that public link from your phone?

@Anonyame
Copy link
Author

Hi @Anonyame multiple webcams are supported in Gradio with the option to switch between them. But the issue may be related to this:

When deploying Gradio within a local network and accessing it from my phone, the image.no_webcam_support issue consistently reoccurs

Does this issue also happen when you create a share link with Gradio (share=True in launch()) and access that public link from your phone?

Yes, this issue consistently reoccurs under any network settings. It is not limited to my phone; it also reliably reoccurs on computers, including the computer used to deploy the service itself.

@abidlabs
Copy link
Member

What OS/browser are you running on? Are there any other special things that may be happening in your environment related to the webcams?

@Anonyame
Copy link
Author

What OS/browser are you running on? Are there any other special things that may be happening in your environment related to the webcams?

The backend has been set up on WSL Ubuntu, Windows, and macOS, while the frontend has been tested on Firefox and Chrome for PC and Android. This issue consistently reproduces across nearly all combinations.

@abidlabs
Copy link
Member

Does this happen when you run the same code in a Google Colab notebook?

@Anonyame
Copy link
Author

Does this happen when you run the same code in a Google Colab notebook?

Oh, I haven't tested that; my internet environment is restricted, so it's difficult for me to access Google. 😢

@xjohnxjohn
Copy link

I test from the coding of @Anonyame , it work perfect.
The backend has been set up on Ubuntu 20.04LTS and the lastest of Gradio.
The screenshot from the android mobile.

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants