Send Motion-user mailing list submissions to
        motion-user@lists.sourceforge.net

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.sourceforge.net/lists/listinfo/motion-user
or, via email, send a message with subject or body 'help' to
        motion-user-requ...@lists.sourceforge.net

You can reach the person managing the list at
        motion-user-ow...@lists.sourceforge.net

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Motion-user digest..."


Today's Topics:

   1. Re: Problem with (both camera's and motion's) auto-brightness
      adjustment (Barry Martin)


----------------------------------------------------------------------

Message: 1
Date: Tue, 1 Jun 2021 11:43:02 -0500
From: Barry Martin <barry3mar...@gmail.com>
To: motion-user@lists.sourceforge.net
Subject: Re: [Motion-user] Problem with (both camera's and motion's)
        auto-brightness adjustment
Message-ID: <4d5320a0-373b-844b-3cc7-a2565cd15...@gmail.com>
Content-Type: text/plain; charset="utf-8"; Format="flowed"



Hi Jay!

(I'm not sure what happened to the formatting - it looked nice originally!)


> (There's a lot of detail here but I'm not providing much additional 
> information, so feel free to skim or skip. )


But that?s like Fast Forwarding through the movie!


> Your ?cheap? SVPro cameras might not be too bad:
> Yeah, I'm pretty happy with the picture quality!


They seem to be a decent quality at a reasonable price ? good especially 
when one is not quite sure of what lens one needs, etc.


>   Have you tested your cameras are working properly ? adjusting to
> brightness ? plugged in to a different computer?
> I tested them (and Motion, in fact, but also with Cheese and briefly 
> with Zoom) on my desktop before connecting them to the RPi. (I'm not 
> using them permanently connected to my desktop because I occasionally 
> have to move my desk and I don't have an easy way to run cables 
> outside from there.


At your desk a USB camera connected to a RPi, wireless to your network. 
Here I hung a non-surge-protected power strip under the desk (because 
powered by a UPS); the desk lamp, etc. plugs into that. I might even 
figure out a way to put the UPS on a wheeled support attached to the 
desk ? I?m lazy so tend to do a lot of work now so I don?t have to do it 
later ? when move the desk the UPS would move with it.


> As you indicated the problem occurred after a power failure, perhaps 
> the SD card is a little corrupted;
> I'm booted from a 1TB USB thumbdrive, since Motion is saving a **lot** 
> of video. Hard to imagine filesystem corruption would affect the 
> **camera's* *auto-brightness adjustment, but I'll try fscking the 
> thumbdrive the next time I have time to take the Pi down and fsck a 
> (currently) ~460GB fileysystem.


Yes, I?ll admit one specific setting or file is a l-o-n-g shot, so said 
just to have you not overlook checking something. Here I?m using either 
a 16 of 32 GB microSD card and saving the recordings immediately to the 
5TB NAS in the basement (via 5G LAN). Old system saved to a USB 
thumbdrive and then copied to the NAS.


> My guess is as it worked fine before the power outage and it would 
> seem a bit odd for both cameras to fail simultaneously, the repeater 
> cables to both fail simultaneously, then that leaves the Pi or its SD 
> card. The card seems the most logical candidate. Wall warts can fail 
> over time
> (see my thread ?Gray glitching but only one of of two identical 
> cameras?: Mark?s reply to me on/about May 23^rd. ? I?m thinking with 
> your numerous power failures maybe the power supply is now iffy. (I 
> run my most of my Pi?s on UPSs or the HAT UPS.)
> There haven't been numerous failures, only the one. (When I said I'd 
> unplugged things, I meant the USB cables to the cameras, among other 
> things to try plugging them into my desktop and make sure they
> were working properly.


Ah! USB is meant to be hot-plugged, so unplugging the cameras shouldn?t 
be a problem. The only issue I have is I generally need to /sudo service 
motion restart/to get motion to re-find the camera after plugging back in.
  


> I saw the same behavior of automatic exposure adjustment not working 
> but manual adjustment succeeding on my desktop, by the way.) So the 
> **cameras** have lost power on a fairly regular basis, which I 
> mentioned only in case there were settings that weren't preserved 
> across a power cycle. (They don't have a power switch, so clearly you 
> just have to unplug them.) I think all their settings are nonvolatile, 
> though.


I would tend to agree. AFAIK the SVPro cameras we?re using do not have a 
memory, so unplugging and plugging back in (to another computer) should 
?reset? the camera. (I know you have two.) What?s weird is moving the 
camera to another computer should ?start fresh?. OTOH if the camera has 
been connected to the ?new computer? before there might be a ?memory? of 
the original configuration. Purge? /sudo apt-get purge cheese/ ? though 
I have seen where not everything is purged; not specifically Cheese, 
just in general. Have a second Pi or at least a spare SD card freshly 
downloaded and try your camera(s) on a fresh OS? This would seem to test 
your cameras ? if auto-brightness on the test system either the cameras 
are damaged or you?re automatically configuring the same error. Could 
also try /cvlc /dev/video0 /(with Motion not running).//



> I added the USB extension cables since this behavior showed up, so 
> they don't affect it, and I've also switched power supplies as part of 
> moving the RPi to a different corner in the basement.


OK, that should eliminate the cables. Here I ran a different camera on 
three (!) 3? USB cables (so 9 feet of extension cable). Originally one 
of the extensions was noticeable skinnier and detected the camera but no 
signal. Swapped in a thicker cable and now could see.

As for the power supply swap, here the wall wart swap stopped the gray 
glitching (whatever it is properly called). As in your situation nothing 
changed I?d tend to guess the power supply isn?t causing the lack of 
brightness adjustment issue.
       
        
> I only **noticed** the problem after that power failure, but I don't 
> know how long before or after that it happened. I think it's likelier 
> that a software upgrade (kernel, video or USB libraries, or Motion itself)
> or me messing around with camera settings with v4l2-ctl caused the 
> problem and the power failure was coincidental.


BTDT! Roll back the configuration? (I?ll admit to not saving old stuff!) 
I?d say try powering down the system than powering back up but seems 
like that was done when moving the desk/stuff around. There have been 
very few times here a reboot/shutdown -r command didn?t clear everything.

I would tend to think it a setting somewhere as Motion hasn?t been 
updated in a while (plus I?m pretty sure it has to be manually 
upgraded). motion -v ? which is an invalid option so gives a help screen 
with the version near the top (motion Version 4.3.2).

Well here?s something: at the bottom is:
Motion is configured using a config file only. If none is supplied, it 
will read motion.conf from current directory, ~/.motion or /etc/motion.
So just maybe you have two motion.conf files, so you?re playing with one 
and Motion is looking at a different one?! (Yes, I?ve BTDT!) Doesn?t 
explain why the cameras also don?t work on a different system but at 
least makes sure you only have the one configuration file. (And possibly 
other configuration file options set by the -c switch.)



> The RPi4 gpu_mem doesn?t work the same as previous versions: less is 
> better. I?m currently using 128 MB, which gives 896 for the CPU 
> (vcgencmd get_mem gpu, vcgencmd get_mem arm commands, respectively). 
> Assigning too much memory to graphics will ?starve? the processor.
> I bumped mine up to 256MB, a comment in /boot/config.txt tells me that 
> was in response to actual problems with Motion and ffmpeg although I 
> don't remmber what they were. (I'm not piping to ffmpeg for Motion's
> normal output, although I had experimented with that at one point, but 
> I have some cron jobs that convert the timelapse mpegs to mp4 after 
> they're complete.)

Probably leave alone for whatever reason you configured for. To me would 
have more to do with general video quality as opposed to specifically 
brightness.


> ...Thought of something: a command option in motion.conf will be 
> overwritten by the same command in your camera configurations. 
> auto_brightness in the camera?s configuration will be used, but only 
> by that specific camera. Default is 0 with a range of 0-3.
> Yup, I currently just have auto_brightness 0 in motion.conf and 
> nothing in the camera?.conf files.

OK ? just checking! I originally followed a tutorial which said to put 
the framerate between 1000 and 1500, so I figure split the difference 
and use 1200. No idea how Motion dealt with that request as now it only 
wants between 2 and 100 (guess it did the default of 15).



> There?s another one called vid_control_params which is generally left 
> blank. As we both have SVPro cameras I?m thinking you want (in 
> motion.conf) **auto_brightness 0* and *vid_control_params** commented 
> out or better yet deleted.
> That's my current state. (I **had** experimented with 
> vid_control_params a bit, which is part of why I wonder whether I've 
> accidentally gotten the cameras in some state I don't know how to get 
> them out of.)

That would be my thought: somehow managed to get two (or more!) config 
files ? how come it works and sometimes not? (Was a different project.) 
*find / -type f -iname *.conf 2>/dev/null* has a lengthy output but 
might be worth looking through to be sure.

Good luck!
Barry




-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------



------------------------------

Subject: Digest Footer

_______________________________________________
Motion-user mailing list
Motion-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/motion-user


------------------------------

End of Motion-user Digest, Vol 180, Issue 1
*******************************************

Reply via email to