A cross-platform command-line tool that detects both wired (USB) and wireless (network/IP) cameras connected to, or reachable from, your machine.
Wired cameras are detected using OS-native tools:
| OS | Method |
|---|---|
| Linux | v4l2-ctl --list-devices (falls back to lsusb) |
| macOS | system_profiler SPCameraDataType |
| Windows | Get-PnpDevice -Class Camera,Image (PowerShell) |
Wireless / IP cameras are detected by scanning your local network:
- Ping-sweeps your subnet using
nmap - Checks common camera ports (
80,554RTSP,8000,8080,8443) - Cross-references device MAC address prefixes against known camera vendors (Hikvision, Dahua, Foscam, TP-Link/Tapo, Wyze, Ring, etc.)
This tool only inspects devices already on your own network — it never attempts to log into, stream from, or exploit any camera it finds.
- Python 3.8+
nmapon yourPATH(required for wireless detection)- Linux:
sudo apt install nmap - macOS:
brew install nmap - Windows: nmap.org/download.html
- Linux:
- (Optional, Linux)
v4l-utilsfor cleaner USB device names:sudo apt install v4l-utils
No pip packages are required — everything uses the Python standard library.
git clone https://github.com/ranjansinghx/camera-detector.git
cd camera-detectorpython3 main.py| Flag | Description |
|---|---|
--usb-only |
Only scan for wired/USB cameras |
--network-only |
Only scan for wireless/network cameras |
--subnet 192.168.1.0/24 |
Manually specify the subnet to scan |
--json |
Print results as JSON instead of a table |
=== Wired (USB) Cameras ===
- HD USB Camera [/dev/video0]
=== Wireless (Network/IP) Cameras ===
- 192.168.1.24 MAC: 4C:11:BF:xx:xx:xx Vendor: Hikvision Open ports: 80, 554
- Network scanning requires your machine to be on the same subnet as the camera(s), and may need elevated privileges (
sudo python3 main.py) for full nmap functionality such as MAC address resolution. - Some routers isolate wireless clients from one another (client/AP isolation), which can hide cameras even on the same Wi-Fi network — check your router settings if a known camera isn't showing up.
- The vendor MAC list in
detect_network.pyis a small starter set. Feel free to extendCAMERA_OUI_PREFIXESwith more vendors.
camera-detector/
├── detect_usb.py # wired camera detection (USB/UVC devices)
├── detect_network.py # wireless/IP camera detection (LAN scan)
├── main.py # CLI entry point
├── requirements.txt
└── README.md