andreknieriem / photobooth

A photobooth Web-Application for raspberry pi with gphoto2
https://photobooth.andrerinas.de/
MIT License
300 stars 163 forks source link

CheeseTime implemented "incorrectly" #129

Closed Norman-Sch closed 5 years ago

Norman-Sch commented 5 years ago

Take.Pic should be run immediately after the countdown. In version 2.0, however, Take.Pic is triggered after CheeseTime expires. This leads to unnecessary delays because until the camera has focused, a certain amount of time passes. When the camera is triggered, "Cheeese" should be displayed. With CheeseTime, this time can be customized.

For example, if the CheeseTime is set to 5000, the picture is taken after 5 seconds of "Cheeese" is displayed. However, the CheeseTime should define how long "Cheese" will be displayed to compensate for the total time the camera was triggered.

Hopefully there will be a quick fix, because Saturday is a wedding again :)

andi34 commented 5 years ago

Please use the template to open an issue for future issues.

Edit: Won't solve the problem, text removed.

Another idea: We could try calling the cheese from takePic function instead takePic from cheese function.

Norman-Sch commented 5 years ago

Another idea: We could try calling the cheese from takePic function instead takePic from cheese function.

Thank you for the tip. For me this solves the problem, but its not that nice. maybe somebody could do better...I am no programmer :D

andi34 commented 5 years ago

@Norman-Sch could you please test https://github.com/andreknieriem/photobooth/pull/133 ?

sualko commented 5 years ago

I would not say "incorrectly", but I understand what you mean. If we follow your proposal and someone sets cheese_time to 5 seconds, but the picture was taken after 2 the cheeeese message would be still there or we would violente the config. The issue is that we can't predict when a picture was taken. The assumption is that the camera triggers after half a second (processingDelay) and the cheese_time is just the foreplay. See also #117 to understand the problem in more detail.

My recommendation is that you set cheese_time to 500ms and adjust core.js#L174 to a good approximation of the time your camera needs to trigger the shutter. Maybe someone makes a pr to adjust this value via the admin settings :wink:, or you have to wait until I did some performance optimizations. The idea is to separate the picture task from the post-processing. This way the takePic request would immediately resolve after a picture was taken.

Btw. if you use this project to make some money it would be nice if you could give something back to the people. One possibility would be a donation to my local red cross community, but don't feel pressured. This is open source :tada:

andi34 commented 5 years ago

Btw. if you use this project to make some money it would be nice if you could give something back to the people. One possibility would be a donation to my local red cross community, but don't feel pressured. This is open source

👍 That's a good thing! That's something I told my Android users too (http://andi34.github.io/donations.html).

andi34 commented 5 years ago

Performance optimizations merged. Can be reopened if there's still an issue with it.