RESTful API to control USB camera settings via v4l2-ctl.
git clone https://github.com/Ernie3/v4l2-ctl-rest-api.git
cd v4l2-ctl-rest-api
npm install
npm start
All endpoints follow the structure GET /{device}/{setting}
or POST /{device}/{setting}/{value}
. You can also get the maximum and minimum values of a setting via GET /{setting}/max_value
or GET /{setting}/min_value
.
You can get the currently supported settings using GET /settings
. This will return all of the supported settings as an array of strings.
If you have a USB device connected to /dev/video0
, you can get its current brightness via GET /0/brightness
, or set its brightness via POST /0/brightness/130
. Or for example if you want to address a camera that is plugged into the top right USB port by its static path (by its USB port), flip the value for by_path
in config.json
then you can POST /1.3/brightness/130
Template
Top Left USB | Top Right USB
----------------------------
Bot Left USB | Bot Right USB
For Raspberry Pi Model B+
1.1.2 | 1.3
-----------
1.1.3 | 1.2
./service_manager.sh argument
install - installs v4l2-ctl-rest-api service and enables start on boot
start - starts v4l2-ctl-rest-api via systemctl (service must be installed)
stop - stops v4l2-ctl-rest-api via systemctl (service must be installed)
enable - enables v4l2-ctl-rest-api to start on boot (service must be installed)
disable - disables v4l2-ctl-rest-api from starting on boot (service must be installed)
uninstall - completely removes v4l2-ctl-rest-api service from systemctl