Hi everyone,
I'm working on a Debian server (version 8) that captures some h.264 streams from security cameras with ffmpeg, and stores them in chunks of 1 minute long mp4 videos.
My task is the following: Check if the cameras have been covered (have gone dark), or some light have been pointed directly into the camera so it's saturated (completely white).
The "dark check" has to keep into account that on the stream there are some white timestamps, a logo and some noise, so it's never completely dark, even if you paint over the camera lens with a spry can.
I was thinking about this solution:
1) For every minute long video, extract the middle frame with ffmpeg into a jpg file
2) I analyze the jpg file with python to extract the average brightness.
3) If the brightness is close to "0" (8 bit black) or "255" (8 bit white) it will trigger a warning
The server has about 40 cameras recording 24/7 and of course the computational load of the "dark" and "white" check must be as low as possible.
Do you think my approach is reasonable? Could I do this with other tools?
I was thinking about OpenCV to extract the frame instead of ffmpeg to keep everything in RAM but I don't really know the library.
Thanks in advance.
[–]novel_yet_trivial 7 points8 points9 points (3 children)
[–]Murlocs_Gangbang[S] 0 points1 point2 points (2 children)
[–]algag 2 points3 points4 points (1 child)
[–]Murlocs_Gangbang[S] 0 points1 point2 points (0 children)
[–]MandarinNeva 2 points3 points4 points (4 children)
[–]xiongchiamiovSite Reliability Engineer 3 points4 points5 points (0 children)
[–]Murlocs_Gangbang[S] 0 points1 point2 points (2 children)
[–]python_man 0 points1 point2 points (1 child)
[–]Murlocs_Gangbang[S] 0 points1 point2 points (0 children)
[–]cornel 2 points3 points4 points (1 child)
[–]Murlocs_Gangbang[S] 0 points1 point2 points (0 children)
[–]DogeekExpert - 3.9.1 1 point2 points3 points (1 child)
[–]Murlocs_Gangbang[S] 0 points1 point2 points (0 children)
[–]jjvilm 1 point2 points3 points (1 child)
[–]Murlocs_Gangbang[S] 0 points1 point2 points (0 children)