Hi, we’re evaluating the Arducam H.264 USB UVC cameras (model UB020201) to include in some large projects, running them on Linux edge devices. The issue is the H.264 stream coming off the camera is over 10 Mbps, which is basically unusable for us over RTSP on the network. We’d really like to set the bitrate directly on the camera so we don’t have to re-encode everything with ffmpeg. Ideally we want to set it with v4l2-ctl and/or through v4l2rtspserver. Do you offer that option at all?
Hi, thanks for the details. On the UB020201 running under Linux, you’d normally talk to it through the UVC/V4L2 stack, so v4l2-ctl and v4l2rtspserver are the right tools to try first. Can you paste the exact commands you’ve run and the output you got back? Also helpful: open a terminal and run
v4l2-ctl -d /dev/video2 --list-ctrls
and paste the full control list. That’ll tell us whether a bitrate control is even exposed by the driver.
Sure. This is what we tried:
v4l2-ctl -d /dev/video2 --set-ctrl=video_bitrate=2000000
and it just comes back with:
unknown control ‘video_bitrate’
We also tried passing a bitrate option through the v4l2rtspserver -c command, but that didn’t seem to do anything either. For what it’s worth, this setup did work at some point, but then it somehow quit working on us. We just need the bitrate lower than 10 Mbps or so.
Thanks, that output is actually the key clue. “unknown control” means the driver didn’t recognize video_bitrate as a valid control at all, so the command never reaches the encoder. The reason the v4l2rtspserver -c attempt didn’t help is the same: v4l2rtspserver just relays what the V4L2 device exposes, it can’t add a control the driver doesn’t have.
Can you still run the list command so we can confirm what the camera actually exposes?
v4l2-ctl -d /dev/video2 --list-ctrls
Here’s the control list we get back:
brightness 0x00980900 (int) : min=-64 max=64 step=1 default=0 value=0
contrast 0x00980901 (int) : min=0 max=30 step=1 default=16 value=16
saturation 0x00980902 (int) : min=0 max=30 step=1 default=16 value=16
white_balance_temperature 0x0098091a (int) : min=2800 max=6500 step=1 default=4600 value=4600
gamma 0x00980910 (int) : min=100 max=300 step=10 default=160 value=160
gain 0x00980913 (int) : min=0 max=30 step=1 default=0 value=0
power_line_frequency 0x00980918 (menu) : min=0 max=2 default=1 value=1
sharpness 0x0098091b (int) : min=0 max=6 step=1 default=2 value=2
backlight_compensation 0x0098090c (int) : min=0 max=1 step=1 default=0 value=0
exposure_auto 0x009a0901 (menu) : min=0 max=3 default=3 value=3
exposure_absolute 0x009a0902 (int) : min=1 max=5000 step=1 default=150 value=83
exposure_auto_priority 0x009a0903 (bool) : default=0 value=0
No bitrate-related control in there, nothing like video_bitrate at all.
So does that mean there’s no way to set it? We really need this working for the project, otherwise we’re stuck re-encoding the stream.
Right, so here’s what’s going on. The bitrate setting you’re trying to use isn’t a V4L2 standard control. That’s why v4l2-ctl returns “unknown control” and why nothing shows up in the --list-ctrls output. Setting the bitrate through v4l2-ctl or through v4l2rtspserver simply isn’t supported as a standard control on this camera.
Because of that, there’s no standard command-line way to lower the H.264 bitrate on the UVC camera itself. The way to get a lower, fixed bitrate on these H.264 cameras is a customization from our side rather than a runtime V4L2 control.
To arrange that, reach out to our pre-sales team at [email protected] and explain that you need a customized bitrate for the UB020201 H.264 UVC camera. They can set up the customization for you.
In the meantime you can also check the forums (https://www.arducam.com/forums/) and the docs (Arducam Wiki) in case anything relevant comes up.
So to summarize: it isn’t a V4L2 standard control, so v4l2-ctl / v4l2rtspserver can’t do it — a custom bitrate setting via pre-sales is the route. Let us know if you have questions along the way.