pyusbcameraindex


Namepyusbcameraindex JSON
Version 1.0.1 PyPI version JSON
download
home_pageNone
SummaryIdentify and select your USB cameras in Python for use with OpenCV.
upload_time2024-06-09 15:57:39
maintainerNone
docs_urlNone
authorJohn Hardy
requires_python>=3.10
licenseCopyright 2024 (Dr. John Hardy) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords opencv python usb directshow index
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">

# pyusbcameraindex

Identify and select your USB cameras in Python for use with OpenCV.

 🚀🤯 Stop guessing the camera index in OpenCV! 🤯🚀

[![PyPI](https://img.shields.io/pypi/v/pyusbcameraindex?logo=python&logoColor=%23cccccc)](https://pypi.org/project/pyusbcameraindex)
![PyPI - License](https://img.shields.io/pypi/l/pyusbcameraindex)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pyusbcameraindex)

![PyPI - Downloads](https://img.shields.io/pypi/dm/pyusbcameraindex)
![GitHub repo size](https://img.shields.io/github/repo-size/JohnHardy/pyusbcameraindex)

</div>

The [pyusbcameraindex](https://github.com/JohnHardy/pyusbcameraindex) package enumerates USB video devices on *Windows* using DirectShow APIs.

Linux and Mac are not supported, but pull requests are welcome.

Usage:
```python
import cv2
from pyusbcameraindex import enumerate_usb_video_devices_windows

# List the devices.
devices = enumerate_usb_video_devices_windows()
for device in devices:
    print(f"{device.index} == {device.name} (VID: {device.vid}, PID: {device.pid}, Path: {device.path}")

# Show a frame from each.
for device in devices:
    cap = cv2.VideoCapture(device.index, cv2.CAP_DSHOW)
    ret, frame = cap.read()
    cv2.imshow(f"Device={device.name}", frame)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break
    cap.release()
cv2.destroyAllWindows()
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pyusbcameraindex",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "opencv, python, usb, directshow, index",
    "author": "John Hardy",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/0f/db/be5dbb838328c4bd7d74960f0fb8bc3ab6aea3f4ee3dd2e0578851d36fc1/pyusbcameraindex-1.0.1.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n\n# pyusbcameraindex\n\nIdentify and select your USB cameras in Python for use with OpenCV.\n\n \ud83d\ude80\ud83e\udd2f Stop guessing the camera index in OpenCV! \ud83e\udd2f\ud83d\ude80\n\n[![PyPI](https://img.shields.io/pypi/v/pyusbcameraindex?logo=python&logoColor=%23cccccc)](https://pypi.org/project/pyusbcameraindex)\n![PyPI - License](https://img.shields.io/pypi/l/pyusbcameraindex)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pyusbcameraindex)\n\n![PyPI - Downloads](https://img.shields.io/pypi/dm/pyusbcameraindex)\n![GitHub repo size](https://img.shields.io/github/repo-size/JohnHardy/pyusbcameraindex)\n\n</div>\n\nThe [pyusbcameraindex](https://github.com/JohnHardy/pyusbcameraindex) package enumerates USB video devices on *Windows* using DirectShow APIs.\n\nLinux and Mac are not supported, but pull requests are welcome.\n\nUsage:\n```python\nimport cv2\nfrom pyusbcameraindex import enumerate_usb_video_devices_windows\n\n# List the devices.\ndevices = enumerate_usb_video_devices_windows()\nfor device in devices:\n    print(f\"{device.index} == {device.name} (VID: {device.vid}, PID: {device.pid}, Path: {device.path}\")\n\n# Show a frame from each.\nfor device in devices:\n    cap = cv2.VideoCapture(device.index, cv2.CAP_DSHOW)\n    ret, frame = cap.read()\n    cv2.imshow(f\"Device={device.name}\", frame)\n    if cv2.waitKey(1) & 0xFF == ord('q'):\n        break\n    cap.release()\ncv2.destroyAllWindows()\n```\n",
    "bugtrack_url": null,
    "license": "Copyright 2024 (Dr. John Hardy)\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \u201cSoftware\u201d), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \u201cAS IS\u201d, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "Identify and select your USB cameras in Python for use with OpenCV.",
    "version": "1.0.1",
    "project_urls": {
        "Bug tracker": "https://github.com/JohnHardy/pyusbcameraindex/issues",
        "Homepage": "https://github.com/JohnHardy/pyusbcameraindex",
        "Repository": "https://github.com/JohnHardy/pyusbcameraindex"
    },
    "split_keywords": [
        "opencv",
        " python",
        " usb",
        " directshow",
        " index"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "24fbac5b6197953f21b785b910905906278cfc0b286fda279987a47b03ae30cd",
                "md5": "df35c8da770f7549e685093f8f8f0c15",
                "sha256": "e3fe457bf6085466912f952b7b9338ae5aed99684cb144fc7b1e591beb83dee8"
            },
            "downloads": -1,
            "filename": "pyusbcameraindex-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "df35c8da770f7549e685093f8f8f0c15",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 5756,
            "upload_time": "2024-06-09T15:57:37",
            "upload_time_iso_8601": "2024-06-09T15:57:37.991658Z",
            "url": "https://files.pythonhosted.org/packages/24/fb/ac5b6197953f21b785b910905906278cfc0b286fda279987a47b03ae30cd/pyusbcameraindex-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0fdbbe5dbb838328c4bd7d74960f0fb8bc3ab6aea3f4ee3dd2e0578851d36fc1",
                "md5": "ab34379c62942a9c98836c6b868528a8",
                "sha256": "88b1c42d7cb98745129f652140264b912f58976b917a6f285872ab9a3d06cd4c"
            },
            "downloads": -1,
            "filename": "pyusbcameraindex-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "ab34379c62942a9c98836c6b868528a8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 5497,
            "upload_time": "2024-06-09T15:57:39",
            "upload_time_iso_8601": "2024-06-09T15:57:39.704844Z",
            "url": "https://files.pythonhosted.org/packages/0f/db/be5dbb838328c4bd7d74960f0fb8bc3ab6aea3f4ee3dd2e0578851d36fc1/pyusbcameraindex-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-09 15:57:39",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "JohnHardy",
    "github_project": "pyusbcameraindex",
    "github_not_found": true,
    "lcname": "pyusbcameraindex"
}
        
Elapsed time: 0.62057s