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

Select webcam #2

Open
omlins opened this issue Nov 10, 2022 · 4 comments
Open

Select webcam #2

omlins opened this issue Nov 10, 2022 · 4 comments

Comments

@omlins
Copy link

omlins commented Nov 10, 2022

First, congratulations on the great project! (I have made quite a bit of google search before deciding to go with your project...)

Is there a way to select the webcam? In my case, on Ubuntu 22.04, it automatically selects the notebook integrated webcam. However, I would need to use a webcam connected with USB.

@jorisparet
Copy link
Owner

Thank you, I'm honored! :)

It's something that I didn't think of, thank you for letting me know.

Well, I expect it to be fairly easy to solve by just changing the integer index here. At the moment, I enforce this index to be zero, because I only expect one device to be connected (a built-in camera for a laptop, or a USB camera for a larger computer). If your USB camera is properly detected, it should simply be given 1 as index.

Unfortunately, I cannot try this myself as I have no USB camera (only a built-in one)... If you have the opportunity to do it, I would kindly ask you to clone the repo, change this index to 1 in hamoco_run.py, locally install the project and tell me whether this solved your problem. If so, I will release a new version on PyPI where one can specify the device index directly in the command line or in the configuration file.

Thanks again. Let me know.

@omlins
Copy link
Author

omlins commented Nov 11, 2022

Thanks! It works when I change the integer to 4. The thing is Linux creates more device nodes for each device to store additional metadata in them as I just recently learned. So if you would like to make it user friendly, then you would somehow need to extract these mapping between these virtual devices and the actual hardware. For me personally, in would be enough to be able to set this integer via a command line argument.

@jorisparet
Copy link
Owner

This is great, thank you. I'll explore a bit your reference about device nodes and update the code accordingly, depending on my ability to create such a mapping.

@jorisparet
Copy link
Owner

Hi, in commit db9967d (branch dev) I added a --device flag to specify the index of the camera being used, e.g. hamoco-run --device 2.

Let me know what you think.

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

No branches or pull requests

2 participants