https://github.com/aivclab/multicam
Python library for using multiple webcams
https://github.com/aivclab/multicam
computervision python webcam-capture
Last synced: 4 months ago
JSON representation
Python library for using multiple webcams
- Host: GitHub
- URL: https://github.com/aivclab/multicam
- Owner: aivclab
- License: mit
- Created: 2020-11-16T14:04:49.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-11-16T14:27:18.000Z (almost 5 years ago)
- Last Synced: 2025-03-12T20:28:55.280Z (7 months ago)
- Topics: computervision, python, webcam-capture
- Language: C
- Homepage:
- Size: 18.6 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Synchronized reading from multiple webcams using v4l2 on Linux
--------------------------------------------------------------
Due to buffering, getting synchronized real-time video from a
single or multiple webcams is difficult, if not impossible.
This framework is intended fix just that.When using multiple cameras, it is a requirement that they support the same configuration.
Installation
------------
`sudo apt install libjpeg-turbo8-dev libjpeg-dev cmake`
`python setup.py install` for system-wide installation
`python setup.py install --user` for user-specific installationUse
---
Multiple cams:
```
import multicam as mc
with mc.Multicam(['/dev/video0','/dev/video2'], (640,480), 'YUYV', fps=30) as cs:
try:
while True:
res = cs.read() #RGB images
print(res.shape)
except KeyboardInterrupt:
pass
```Single cam:
```
import multicam as mc
with mc.Camera(0, (640,480), 'YUYV', fps=30) as c:
print(c.read().shape)
```Various utils:
```
import multicam as mc
print(mc.list_cams())
print(mc.is_valid_device("/dev/video0"))
print(mc.get_formats("/dev/video0"))
```