I want to create an MD5 hash for each shot captured with gphoto2.
I tried to run this command
sudo gphoto2 -capture-image-and-download -force-overwrite \
-filename capture.jpg -I 10 && md5sum capture.jpg > md5.txt
but the checksum writes only when gphoto2 was stopped. I need to write it for each shot as it is captured?
gphoto2 versions newer than 2.3.0 have the option --hook-script FILENAME
; you could write a short script file, eg named hook.sh
:
case $ACTION in download) md5sum "$ARGUMENT" >md5.txt
esac
(don't forget to make it executable) and then
sudo gphoto2 -capture-image-and-download -force-overwrite \
-filename capture.jpg -I 10 --hook-script hook.sh
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.