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 /{deviceId}
, GET /{deviceId}/{setting}
or POST /{deviceId}/{setting}/{value}
. You can also get the maximum and minimum values of a devices setting via GET /{deviceId}/{setting}/max_value
or GET /{deviceId}/{setting}/min_value
.
You can get list of all available devices by using GET /devices
. This returns a list of device ids as and array of integers.
You can get the device supported settings using GET /{deviceId}/settings
. This will return all of the supported settings for the device 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/0/130
.
./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