gen2brain / cam2ip

Turn any webcam into an IP camera
GNU General Public License v3.0
872 stars 90 forks source link

Add ability to choose camera by ID #39

Open bronzegoddess opened 1 year ago

bronzegoddess commented 1 year ago

Currently when I run the program I go through a series of indexes until I find the right camera on my mac. -index 1, 2, 3 etc

It would be nice if we could call the camera by its Unique ID. Example:
Unique ID: 0x4015000005ac1112

Also, it would be even better if the program would tell us what those Unique Ids are (on our system)

Full Example

  1. Start the program by running it via index /Users/bronzemedia/Downloads/cam2ip -index 2 -bind-addr ":4444" -width 1920 -height 1080

  2. The system responds with:

    _Listening on. :4444
    CameraID.     : 0x4015000005ac1112_  
  3. Then next time we can call it like this: /Users/bronzemedia/Downloads/cam2ip -cameraid "0x4015000005ac1112" -bind-addr ":4444" -width 1920 -height 1080

gen2brain commented 1 year ago

Unfortunately, OpenCV which is used for macOS doesn't provide a name or ID, only an index. Even in native Linux and Windows implementations, I don't see a way, perhaps it is possible to dig that info on Windows. At least, on Linux is possible to always map the camera indexes via UDEV so they don't change.

bronzegoddess commented 1 year ago

Thank you for the clarification. I will look into disabling other cameras on my Mac so that the webcam is the only option.