Install ghoto2 on Raspberry Pi (memo)

gphoto2

To install ghpto2, there is Sage gonzalo who puts it together in one command, so download the script. And execute. It takes a long time to execute, but it succeeds without catching anything.

wget https://raw.githubusercontent.com/gonzalo/gphoto2-updater/master/gphoto2-updater.sh
chmod 755 gphoto2-updater.sh
sudo ./gphoto2-updater.sh
	1) Install last development version
	2) Install last stable release (libgphoto 2.5.14; gphoto 2.5.14)
	3) Quit
	=>Select 2

Allow python to call gpohoto2.

sudo pip3 install gphoto2
sudo pip install gphoto2

pyQt4

Required for programs that use the GUI. pyQt5 could not be installed. .. ..

sudo apt-get install python-pyqt4
sudo apt-get install python3-pyqt4

examples

Download examples from git, run it, and it works.

git clone https://github.com/jim-easterbrook/python-gphoto2
cd python-gphoto2/examples
python3 camera-summary.py

I took a picture

While looking at the manual, try executing a command that seems to be possible immediately. The camera used was the EOS-M3.

gphoto2 --capture-image-and-download

This is a command to shoot with the current camera settings and transfer the image to the Raspberry Pi side. After the transfer, the images will be deleted from the main unit, and if there are image files in the directory on the Raspberry Pi side, they will be serialized **. It's amazing.

When measured with the time command, it took just over 13 seconds from shooting 24M RAW + JPEG to completing the image transfer. It takes about 3 seconds from focusing to the release of the shutter, and another 3 seconds to start image transfer. Is this the ability of the camera?

# time sudo gphoto2 --capture-image-and-download
New file storage location: /store_00010001/DCIM/187_0917/IMG_2413.CR2 file IMG_2413.Save as CR2
Files in the camera/store_00010001/DCIM/187_0917/IMG_2413.I'm removing CR2
New file storage location: /store_00010001/DCIM/187_0917/IMG_2413.IMG a JPG file_2413.Save as JPG
Files in the camera/store_00010001/DCIM/187_0917/IMG_2413.I'm deleting JPG

real    0m13.243s
user    0m1.090s
sys     0m0.980s

gphoto2 --capture-preview

The live view image is transferred as a still image. In the case of this camera, it was saved at 480x320. The shutter does not release. The measurement result with this time command is a little over 2 seconds.

If capture_preview.jpg is in a directory, adding "--skip-existing" will exit without overwriting, and adding "--force-overwrite" will force it to be overwritten.

# time sudo gphoto2 --capture-preview
Capture file_preview.Save as jpg

real    0m2.434s
user    0m0.220s
sys     0m0.060s

gphoto2 --capture-movie

** Continuously capture live view images and transfer as MJPEG **. This is amazing. In the case of this camera, it was saved at 480x320. The shutter does not release.

The manual says that the number of seconds is specified, but the number of shots that can be taken is one more. The frame rate is unknown. Is it possible on the camera side?

By the way, there is VLC as a viewer that supports MJPEG.

#time sudo gphoto2 --capture-movie 30
Capturing 30 preview frames as movie to 'movie.mjpg'.
Movie capture finished (31 frames)

real    0m3.030s
user    0m0.170s
sys     0m0.160s

Recommended Posts

Install ghoto2 on Raspberry Pi (memo)
Install OpenCV4 on Raspberry Pi 3
Install TensorFlow 1.15.0 on Raspberry Pi
raspberry pi 4 centos7 install on docker
Install OpenMedia Vault 5 on Raspberry Pi 4
Install 64-bit OS (bate) on Raspberry Pi
Install docker-compose on 64-bit Raspberry Pi OS
How to install NumPy on Raspberry Pi
pigpio on Raspberry pi
Raspberry Pi 4 setup memo
Cython on Raspberry Pi
Make DHT11 available on Raspberry Pi + python (memo)
Install Raspberry Pi OS (Raspbian)
Raspberry Pi + Python + OpenGL memo
Introduced pyenv on Raspberry Pi
Use NeoPixel on Raspberry Pi
Install pyenv on Raspberry Pi and version control Python
MQTT on Raspberry Pi and Mac
Install Memo
Try using ArUco on Raspberry Pi
OpenCV installation procedure on Raspberry Pi
Power on / off Raspberry pi on Arduino
Detect switch status on Raspberry Pi 3
L Chika on Raspberry Pi C #
Build wxPython on Ubuntu 20.04 on raspberry pi 4
"Honwaka Notification Lamp" on Raspberry Pi Part 2
Detect "brightness" using python on Raspberry Pi 3!
USB boot on Raspberry Pi 4 Model B
"Honwaka Notification Lamp" on Raspberry Pi Part 1
Enable UART + serial communication on Raspberry Pi
Adafruit Python BluefruitLE works on Raspberry Pi.
Accelerate Deep Learning on Raspberry Pi 4 CPU
Set swap space on Ubuntu on Raspberry Pi
Programming normally with Node-RED programming on Raspberry Pi 3
Use the Grove sensor on the Raspberry Pi
Run servomotor on Raspberry Pi 3 using python
"Honwaka Notification Lamp" on Raspberry Pi Part 3
Working with sensors on Mathematica on Raspberry Pi
Build OpenCV-Python environment on Raspberry Pi B +
Detect temperature using python on Raspberry Pi 3!
Mount Windows shared folder on Raspberry Pi
Matrix multiplication on Raspberry Pi GPU (Part 2)
I installed OpenCV-Python on my Raspberry Pi
Working with GPS on Raspberry Pi 3 Python
Raspberry Pi backup
Why detectMultiScale () is slow on Raspberry Pi B +
Detect slide switches using python on Raspberry Pi 3!
[Procedure memo] Install Python3 + OpenSSL locally on Ubuntu
Build a Django environment on Raspberry Pi (MySQL)
Try using a QR code on a Raspberry Pi
Detect magnet switches using python on Raspberry Pi 3!
Enjoy electronic work with GPIO on Raspberry Pi
Power on / off your PC with raspberry pi
Use Grove-Temperature & Humidity Sensor (DHT11) on Raspberry Pi
Beginning cross-compilation for Raspberry Pi Zero on Ubuntu
Sound the buzzer using python on Raspberry Pi 3!
Play with your Ubuntu desktop on your Raspberry Pi 4
Display CPU temperature every 5 seconds on Raspberry Pi 4
Introduced Ceph on Kubernetes on Raspberry Pi 4B (ARM64)
Connect to MySQL with Python on Raspberry Pi
Build a Python development environment on Raspberry Pi