A Python library for controlling DSLR cameras using the open source program digiCamControl. Please see digicamcontrol.com for more information.
Report Bug
·
Request Feature
DigiCam is a wrapper around digiCamControl's command line interface, so it is Windows only.
- Download digiCamControl here and select digiCamControl Stable Version.
- Install it. By default the command line executable lands at:
C:\Program Files (x86)\digiCamControl\CameraControlCmd.exe - Connect your camera by USB and confirm digiCamControl sees it. digiCamControl locates the port automatically.
You will pass the path to CameraControlCmd.exe into Camera, so make a note of where yours ended up.
From PyPI:
pip install DigiCamOr from source:
git clone https://github.com/jtcass01/DigiCam.git
cd DigiCam
pip install .from DigiCam import Camera
# Replace with the absolute or relative path to your CameraControlCmd executable.
camera_control_cmd_path = 'C:\\Program Files (x86)\\digiCamControl\\CameraControlCmd.exe'
camera = Camera(control_cmd_location=camera_control_cmd_path)
camera.capture_single_image(autofocus=True)save_folder is created for you if it does not exist. collection_name is prefixed to every
filename, and an index is appended so each shot is unique — the example below writes
sunset_0.jpg, sunset_1.jpg, and so on.
camera = Camera(control_cmd_location=camera_control_cmd_path,
image_type='jpg',
collection_name='sunset',
save_folder='D:\\photos\\2026-08-11')
camera.capture_single_image()Supported image_type values are 'jpg'/'jpeg', 'png', 'raw', and '.CR2'. Anything
else falls back to .jpg.
Settings are pushed to the camera by generating a .dccscript and running it. Any setting left
as None is not sent, so the camera keeps its current value for that property.
from DigiCam import Camera
camera = Camera(control_cmd_location=camera_control_cmd_path)
settings = Camera.Settings(aperture='2.8',
exposure_control='1',
shutter_speed='1/125',
iso='400')
camera.setup(settings)
camera.capture_single_image()Values are passed through to digiCamControl verbatim, so they must be values your camera
actually supports. iso='AUTO' is accepted by most bodies.
frequency is in images per second, so frequency=0.5 waits two seconds between shots.
# 60 frames, one every two seconds.
camera.capture_multiple_images(image_count=60, frequency=0.5)| Argument | Type | Description |
|---|---|---|
control_cmd_location |
str |
Path to CameraControlCmd.exe. Required. |
image_type |
str | None |
'jpg', 'png', 'raw', or '.CR2'. Defaults to .jpg. |
collection_name |
str |
Prefix for every captured filename. |
save_folder |
str |
Directory for captured images. Created if missing. |
| Method | Description |
|---|---|
capture_single_image(autofocus=False) |
Captures one image and increments the image index. |
capture_multiple_images(image_count, frequency=1.0) |
Captures image_count images at frequency images per second. |
setup(settings, setup_script_name='setup.dccscript') |
Generates a setup script from settings and runs it. |
generate_setup_script(settings, setup_script_name) |
Writes the .dccscript without running it. |
run_script(script_name) |
Runs an existing .dccscript. |
command_camera(command) |
Sends a raw digiCamControl command. |
Holds the camera properties written into a setup script. to_dict() returns them keyed by the
property names digiCamControl expects.
AssertionError: Unable to locate: ... — the path you passed is not CameraControlCmd.exe.
Check under C:\Program Files (x86)\digiCamControl\ and C:\Program Files\digiCamControl\. Note
that CameraControlCmd.exe is the command line tool, not CameraControl.exe.
Nothing happens and no image appears — digiCamControl commands fail silently. Run the same command by hand to see its output:
"C:\Program Files (x86)\digiCamControl\CameraControlCmd.exe" /capturenoafThe camera is not detected — make sure the camera is in a mode that allows tethered capture and is not mounted as a mass storage device. If the digiCamControl GUI is open, try closing it; the GUI and the command line tool can compete for the camera.
Captures fail with autofocus on — a camera that cannot achieve focus refuses the shot. Use
capture_single_image(autofocus=False) to capture regardless of focus.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Tests that need digiCamControl installed, or a camera connected, are skipped automatically, so the suite passes on a fresh clone:
python -m unittest discover -s test -vDistributed under the GPL-3.0 License. See LICENSE for more information.
Jacob Taylor Cassady - jacobtaylorcassady@outlook.com
Project Link: https://github.com/jtcass01/DigiCam