[cam] section
You have to create a [cam] section per camera and name your cameras by placing the name inside the square brackets.
[cam raspi]
mode: camera-streamer
...
[cam logiC270]
mode: ustreamer
...The word cam must be set!
This is a keyword to determine that this section belongs to a camera setup.
mode
The streaming mode used by Crowsnest.
Default: mode: ustreamer
Available options:
enable_rtsp
If `mode: camera-streamer` is used, this will enable the RTSP Server of camera-streamer.
rtsp_port
This setting allows you to set a port for the rtsp server. Only available with `mode: camera-streamer`
port
The network port through which the camera is accessible. This setting only affects the mjpg mode (ustreamer).
Default: port: 8080
Note: In MainsailOS, by default four webcam ports are mapped to URLs. Notice that the first URL doesn't contain a number. You can simply add these to the Mainsail settings.
8080
/webcam/?action=stream
/webcam/?action=snapshot
8081
/webcam2/?action=stream
/webcam2/?action=snapshot
8082
/webcam3/?action=stream
/webcam3/?action=snapshot
8083
/webcam4/?action=stream
/webcam4/?action=snapshot
A small note on WebRTC
In order to use WebRTC, please replace ?action=stream with webrtc. Keep in mind this will only work if you use mode: camera-streamer.
Don't change the URL Snapshot! This will be the same as before.

device
The path of the video device (camera) to be used by the configured streaming service. All available devices are listed in the log file every time Crowsnest is started. You can copy the path from there.
Default: device: /dev/video0
A path in this format is also valid:
resolution
The desired streaming resolution, formatted as heightxwidth without spaces.
Default: resolution: 640x480
Note: This is case sensitive! Do not use capital 'X' !
There are two practical ways to determine, which resolutions are supported by your device:
from crowsnest.log
using
dev-helper.shfromtoolsdirectory
max_fps
The desired streaming FPS (frames per second).
Default max_fps: 15
Note:
It is necessary to research which FPS in combination with which resolution your camera supports. For detailed information run
v4l2-ctl --list-formats-extin your SSH session.The FPS has a big impact on the bandwidth, especially in mjpg mode.
This setting is mostly ignored in rtsp mode.
custom_flags
This setting allows you to pass advanced parameters to ustreamer. It is possible to adjust image parameters such as brightness, contrast and saturation, or to flip the image. The passed parameters are appended to the already configured parameters. However, your camera needs to support these advanced parameters as well.
Default: custom_flags:
Note: The flags are separated by a single space, not by a comma.
You need to take a closer look at the documentation of the ustreamer project. As a guide, we have placed ustreamer's manpage in crowsnest repository.
v4l2ctl
This option allows to pass parameters for the configured device to V4L2 "the driver". Depending on the camera model, it is possible to pass different parameters, but not all parameters are supported by every camera. Commented out by default.
Note: It is a very tough topic and is only recommended for advanced users.
All parameters have to be seperated by using a comma !
Example: v4l2ctl: paramter1=value1,parameter2=value2,parameter3=....
There are also two ways to determine what your device is capable of
via crowsnest.log
or as earlier mentioned using
dev-helper.shscript
Example of an application
A Logitech C920 camera has autofocus activated by default. To get a nice picture, the manual focus should be activated. Until now, one had to use a cronjob that executes a script with v4l2-ctl commands. This was very inconvenient and a lot of set-up.
In Crowsnest you can simply specify these options in the config:
Restart Crowsnest service via Mainsail and you're good to go.
Take a look at alexz' crowsnest.conf file.
Last updated
Was this helpful?
