Dafang-Hacks / Main

138 stars 63 forks source link

have ImpEncoder.cpp write pictures #75

Closed claud9999 closed 3 years ago

claud9999 commented 3 years ago

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.

nik0 commented 3 years ago

You are right But the image is written anyway. What would be the gain ?

claud9999 commented 3 years ago

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.

claud9999 commented 3 years ago

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.

nik0 commented 3 years ago

Ok for the delay I am not sure about the rest (as the image is saved anyway)