Hacker News new | past | comments | ask | show | jobs | submit login
Libgphoto2 Controls Digital Cameras (gphoto.org)
78 points by brudgers 42 days ago | hide | past | web | favorite | 17 comments



I used gphoto2 circa 5 years ago in order to capture photos from an automated photography rig. The library was great and I was able to control the timing well enough to use with a flash (single flash for multiple cameras)

As another comment has pointed out, the flaw was the firmware on the cameras. Canon 60D and 600D were the two models I was using and they were so lible to freezing (i.e. stop responding on USB or to button presses on the camera) that I had to set up a relay on the tethered power supply to be able to hard reset them from time-to-time. I'm 100% sure libgphoto2 wasn't to blame because I also used a tethered capture tool from Canon on windows and that also suffered from the same symptoms.

Great library though and great maintainers!


HI’m doing exactly the same now using the M50, and (no surprise) it has the same problems!

I’ve found that libusb has some useful tools for working around this kind of problem. There is a useful CLI tool for resetting individual ports on some hubs (https://github.com/mvp/uhubctl) which makes good use of this feature. May not fix everything but works for most use cases.


For those who don't know, Entangle does just that (using libgphoto2):

https://entangle-photo.org/


I’ve used libgphoto2 for a few years now and have contributed some as well, but have been frustrated by the slow performance for tethered shooting due to legacy code since it was originally designed as more of a file browser. The vast camera support of libgphoto2 is hard to beat, though.

That said, I’ve been building a pure JavaScript replacement for it. It’s still a work in progress, but for changing settings, live view and capture, it performs significantly better and now supports many Canon, Nikon, Sony, Fuji, Panasonic and Olympus cameras. I’m going with an open-source/commercial license model for it, and once it’s further along will package it better. For now, you can check it out in this subfolder: https://github.com/timelapseplus/VIEW/blob/master/camera/ptp... (api.js is the one to require)


I enjoy CLI photo management and have a few scripts of my own. Looked over the docs of this project but not entirely clear on why I would use this when most cameras are mounted as a disk already.

Is remote camera control the main use case now? Are there other use cases?

Edit: The Entangle link in this discussion appears to support this assumption.


To me, remote camera operation seems to be the critical feature that is hard to get elsewhere. It's also increasingly available on new camera models.


I'm curious if it's possible to make the switch from Lightroom to Darktable (which uses libgphoto2 underneath I believe). The last time I tried was years ago and it was not a success.


Looking at tethering support in Darktable is how I came across libgphoto2.

I'd say switching comes down the switch's goal and how committed you are to that goal versus how committed you are to your current workflow. At the level of mouse movements, switching means abandoning your LightTable workflow and making a new one in Darktable. At the level of tooling, switching means finding equivalent tools and/or combinations of tools to achieve your photographic results...or living without some LightRoom tools. At the high level, the proof is in the print.

It might be worth watching some of Bruce Williams Darktable tutorials on Youtube. https://www.youtube.com/channel/UCkqe4BYsllmcxo2dsF-rFQw


I've been trying to migrate my flow from Lightroom to purely OSS tools. So far I've landed on a big mess of importing RAW with the gphoto2 CLI so that I've got a reliable archive to then feed the other tools: digiKam for active library management of the shots I want to develop, Rawtherapee and Darktable for processing, and then the GIMP for final touchups.

As much as I find Adobe distasteful, it's a much, much smoother experience. If you don't mind hacking away to find a workflow that works for you, you'll get similar results out of open source tools -- but the path to those results is much longer.


Darktable and Rawtherapee support many RAW formats directly. Gimp supports many RAW formats with a plugin. For those workflows, preprocessing with libgphoto2 may not be required.


gphoto2 is more for archival. For whatever reason it feels safer to me to use the CLI as a feeder for the other apps; gphoto2 grabs the photos off the camera, pops them in a folder, and I then import into digiKam from there rather than from the camera.

The archive is independently backed up and remains a pristine home for all my digital negatives, without the risk of me annihilating things in digiKam/Darktable, which I am wont to do ;).


That makes sense. I use Rapid Photo Downloader to ingest images. It handles renaming, directory creation, and teeing the data stream to a primary and a backup location. https://www.damonlynch.net/rapid/ It replaced shell my scripts about two years ago. Periodically, I archive the online disks to an offline disk.

When the online backup disk is full, I archive it and buy another. Likewise with the SD cards from the camera, I shoot until they are full and then archive them. I don't delete images off of them and replace them when full. I treat SD cards as a consumable...like film.


Thanks for the link, I'll take a look :).


What a great library! And Jim Easterbrook's adaptation for python is the center of my life right now.


On a side note, Nikon D750 has an utterly retarded remote protocol. Or PTP is really that bad.

For example: you shoot a photo, then the camera sends it via USB to the host. Takes multiple seconds, instead of just saving it to the SD-card. No queuing either, so you need to wait before shooting again.


`gphoto2 --set-config capturetarget=1` I think might work for what you want.


I solved it (was some weeks ago) by using a relay with a Raspberry attached to the remote shutter port.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: