MMAL and V4L2 are two APIs for multimedia.
MMAL is Broadcom specific, but exposes all the features of the hardware.
V4L2 is defined by a group of Linux kernel developers, is common to almost all Linux devices, but in being generic means that not all the features can be exposed.
Motion's autobrightness algorithm by default appears to adjust the brightness control of the V4L2 device. That is typically applied solely as digital gain, so you don't gain any extra detail. To improve the scene detail you need to be adjusting exposure time or analog gain. Typically those are controlled automatically, but within ranges defined by the exposure mode, which in turn can be controlled by the V4L2 scene mode.
The V4L2 driver does support a "night" scene mode, which allows significantly longer exposure times, and higher gain than normal mode. You MUST reduce the frame rate requested in order to achieve longer exposure times - there's no way to produce 30fps with exposure times greater than 33ms as physics won't allow it.
You can try the commands:
Code: Select all
v4l2-ctl --set-ctrl=scene_mode=8
v4l2-ctl -p 5
to request night mode and 5fps, although that does assume that motion doesn't override any of those settings (there is a "framerate" parameter according to
https://rawgit.com/Motion-Project/motio ... nfig_Files).
I do note that
https://github.com/Motion-Project/motion has merged in support for using MMAL on the Pi, but it does state that that has not been merged to the main repos as yet (it only got added in Sep 2016, and Debian moves slowly)