Giter Site home page Giter Site logo

Comments (12)

falkoschindler avatar falkoschindler commented on July 4, 2024

I'd like to request this feature as well.

In order to distinguish multiple cameras I generate symlinks like /dev/logitech to /dev/video0 using /etc/udev/rules.d/. With an integer device id I can't be sure which camera is which device after rebooting. A string would allow to open the Logitech camera explicitly.

from cv_camera.

OTL avatar OTL commented on July 4, 2024

Hi

It seems possible to use ~file parameter to set device file.
(I have not tested yet, just read the code)

Could you try ~file param?

from cv_camera.

falkoschindler avatar falkoschindler commented on July 4, 2024

Unfortunately, using the file parameter yields an error:

cv camera open failed: file /dev/logitech cannot be opened.

from cv_camera.

OTL avatar OTL commented on July 4, 2024

thanks!

below link shows that nobody answers the question "how to open with device file path".

http://stackoverflow.com/questions/20266743/using-device-name-instead-of-id-in-opencv-method-videocapture-open

If you find the answer, please let me know!

from cv_camera.

falkoschindler avatar falkoschindler commented on July 4, 2024

Yes, I've also seen this post.

Don't you think one of the two answers might work in your case? If you follow the symbolic link /dev/logitech and get the path of the actual device /dev/video42, you might be able to extract the device id 42.

from cv_camera.

OTL avatar OTL commented on July 4, 2024

I really know what you want, why you want, because I also have experienced exactly same situation for several time.

My concern is

  • Is it portable (at least, it should work on osx, possibly windows...)?
  • I don't want to add dependencies like boost::filesystem, if possible.

Isn't it possible to use static video number using udev?

from cv_camera.

falkoschindler avatar falkoschindler commented on July 4, 2024

I totally understand your concerns.

I'll look into assigning static video numbers using udev, as you suggest. It can take some time, since it's currently not my main focus. I just found cv_camera, liked it for its nodelet functionality, but struggled with the device id and, thus, quickly voted for this feature request. :)

from cv_camera.

mgmeedendorp avatar mgmeedendorp commented on July 4, 2024

Hi,

It seems that the StackOverflow question linked earlier (here) has finally been answered, so this would resolve this issue.

from cv_camera.

OTL avatar OTL commented on July 4, 2024

from cv_camera.

mgmeedendorp avatar mgmeedendorp commented on July 4, 2024

I posted a PR on this issue #8

from cv_camera.

OTL avatar OTL commented on July 4, 2024

Thank you! Added some small comments. Could you fix them?

from cv_camera.

OTL avatar OTL commented on July 4, 2024

merged

from cv_camera.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.