Closed claud9999 closed 3 years ago
You are right But the image is written anyway. What would be the gain ?
So ImpEncoder.cpp has the current image causing the motion detection trigger, but it calls out to a shell which calls out to a program which calls out to shared memory which has changed in the meantime to be a couple frames later. Lots of delays between the motion detection and the capturing/storing of an image.
So ImpEncoder.cpp has the current image causing the motion detection trigger, but it calls out to a shell which calls out to a program which calls out to shared memory which has changed in the meantime to be a couple frames later. Lots of delays between the motion detection and the capturing/storing of an image.
Plus, while I haven't researched it, there may be some (minor) performance impacts to having the current image frame in shared memory rather than regular RAM.
Oh also mutex overhead.
Ok for the delay I am not sure about the rest (as the image is saved anyway)
So it seems that shared memory is only used for two things: configuration (so that they can be updated by an external program and have the config loaded into the already-running server) and shared between v4lrtsp-server and getimage.
Given that the process is currently v4lrtsp-server identifies motion->detectionOn.sh->getimage->shared memory, why not skip the whole loop and have ImpEncoder.cpp just write the image directly (and the shell script could move the image file, if needed.)
The location/filename format can be passed via the configuration structure.