Closed lastbestmatt closed 7 years ago
Thanks for the bug report. I had seen this problem but never had the time to investigate so thank you for the fix.
Will we always have a whitespace after the name in v4l2-ctl? Is that part of the formatting?
It's a good question, I'm not sure. I also considered \b for a word break, which would catch both a whitespace or a colon. However, this wouldn't allow for names with a hyphen (-) in them if those exist (it would allow underscores).
Just remember to escape the slash in the string, or you'll really confuse yourself.
I am back in the office now and checked my RPi. The original regex is fine. I have a fork of rpos (with extra things like PTZ support and Aux/Relay support) and will add it into my fork too.
For the record, we should note that the sense of auto_exposure is backwards in these settings. A value of 0, or unchecked, means auto exposure is on. A value of 1 or checked means manual exposure. Not sure the easiest way to note this in the interface, but I suppose you could change it to a menu/dropdown type where "on" = 0 and "off" = 1.
This bug has been fixed in RPOS now. (I've pulled in the Pull Request from my fork). Thanks again for the bug report
While using rpos, I noticed that when setting
video_bitrate
through the web interface, the value is not preserved. The value always reads '0' in thev4l2ctl.json
settings file. I tracked this down to what I think is a RegExp bug inv4l2ctl.ts
In the
ReadControls()
function, we take the control name and append the variableregexPart
to create a RegExp that is matched against the output ofv4l2-ctl -l
command.The problem shows when two different controls start the same way: in this case
video_bitrate_mode
andvideo_bitrate
. The regex will matchvideo_bitrate_mode
for both controls. So, when you attempt to setvideo_bitrate
, it takes affect and even gets written to file correctly. But anytime the file is read, the value ofvideo_bitrate_mode
will be captured for both controls.To fix, you could change
to
This will require whitespace after the control name, which will limit the RegExp to only match the correct control.