Giter VIP home page Giter VIP logo

Comments (6)

awesomebytes avatar awesomebytes commented on July 17, 2024

Hello, I'm the original author of the package. When I wrote this package I was guided by the OpenCV API docs to believe that OpenCV supported opening a video provider by two (necessarily different) calls:

  • Capture with an index (int) for video devices
  • Capture with a filename (string) for streams and video files

When reading the actual source code of that method:
https://github.com/opencv/opencv/blob/1acadd363b0d0ffcdabac8af3196cb65bef426b1/modules/videoio/src/cap.cpp

It 'seems' like the string method should be able to deal with a path being a video device... when I tried, it didn't work for me. So I ended up having that way of differentiating if it's a video device just getting the number of the device. I see that it works for you! Maybe it's based on the backend that OpenCV is using? At the time I wrote it for OpenCV 2.X.Y... I don't really know.

In your case, the only thing I can recommend, is to find which index device makes the program find your camera. If you have no other cameras, it will be 0 most probably. The launchfile just needs the number, e.g. 0, as in the example launchfile.

Good luck! I hope it's useful for you.

from video_stream_opencv.

mjsobrep avatar mjsobrep commented on July 17, 2024

Gotcha, that makes sense. The path as a video device seems to work well for me. Getting the number does work, but those numbers are not stable, correct? By using a path using either video for linux or udev you can guarantee that you always get the device you want.

from video_stream_opencv.

awesomebytes avatar awesomebytes commented on July 17, 2024

@mjsobrep Hey, just wanted to give a heads up here. I haven't been very active as I'm pretty busy finishing writing my PhD dissertation, I hope @furushchev has a moment to also review your PR. Otherwise, I'll probably test and merge your PR when I have a bit of time off... worst case in a month probably. I think your PR will fix the issue you report here in a very nice way.

Thanks again for bringing this up and providing a simple and beautiful fix.

from video_stream_opencv.

mjsobrep avatar mjsobrep commented on July 17, 2024

@awesomebytes Thanks for the heads up. Good luck on the dissertation!

from video_stream_opencv.

furushchev avatar furushchev commented on July 17, 2024

@mjsobrep Thank you very much for contribution. The issue is now solved on #60 being merged.

from video_stream_opencv.

mjsobrep avatar mjsobrep commented on July 17, 2024

Sure thing. Glad to help

from video_stream_opencv.

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.