Version (15 KB) by Serge
Controller for supported DSLR cameras via digiCamControl application
Updated 24 Jan 2020

Controller v1.3.9 for tethered DSLR cameras using digiCamControl app.
C = CameraController -create class
C = CameraController(dcc) -digiCamControl location
C = CameraController(dcc,debug) -set debug level
dcc: digiCamControl's webserver IP or CMD remote utility folder.
If empty this class tests the default webserver, 'localhost:5513', then
default app install locations, 'C:\Program Files (x86)\digiCamControl'.
debug: 0=silent, 1=minimal (default), 2=print requests, 3=print replies

-This class uses digiCamControl (windows only app) to control supported
cameras: set ISO, exposure, focus, aperture(fnumber), white balance,
stream liveview, capture photos & video, configure file download, etc.
-digiCamControl is a multi purpose, free, open source, Windows only
application that can control a host of supported cameras.

1.Install latest version of digiCamControl from:
2.Enable webserver: File > Settings > Webserver > Enable "Use web server,
& "Allow interaction via webserver", use port "5513" > !RESTART APP!
3.Connect one or more cameras using USB cable (or WiFi if supported?).
4.For full control of a Canon DSLR set body and lens to manual.
5.Use digiCamControl app to ensure camera is working.

-This class communicates with camera(s) via digiCamControl's included
webserver(recommended) or CMD Utility.
-The webserver is much faster and allows camera(s) to be controlled from
any Windows/Linux computer on the network or via the internet.
-Visit for documentation, forums and to donate.
-Method in this class are Capitalised and have additional descriptions.
-When this class is created it does a one-off retrieval of allowed camera
options. Reinitialise this class when swapping cameras.

-This class can only stream liveview (low-rez, noisy, ~15Hz) from
supported cameras. However digiCamControl does support "Open Broadcaster
Software" (OBS) and "XSplit", see Streaming and Search the Forums for info.
-Non-alphanumeric characters found in some Nikon camera properties are
being removed. These properties can be read but cannot be set.
eg "-", "." in "center-weighted_area" "active_d-lighting" "long_exp._nr"
-See digiCamControl Knwon Bugs:
-Focus method does not know how long it needs to wait after a focus change
is requested, see Focus method help to set custom delays.
-LiveView can only be 'streamed' when using the webserver.

Camera Settings:
-Some settings will not have affect if camera is not in Manual mode (M).
-To control focus ensure lens is set to Manual Focus (MF):
-Focus step size & speed can be modified in: File>Settings>Live view
-Note: Lenses use servo motors which have no discrete physical 'steps'. To
achieve a specific focus reproducibly try to go to the lens's physical
limit, in either direction, and apply the same 'steps' from there.

Image Capture:
-To reduce capture latency from 0.3-0.6 sec to ~0.05s ensure webserver is
enabled, File>Settings>Webserver>Enable>RESTART APP
-To measure delay and variance try imaging the computer's own clock by
calling the Clock method provided with this class, C.Clock, however
I do not know how to measure monitor display latency and variance.
-Cmd('CaptureAll') will trigger all connected cameras but there will be a
lag of 0.005-0.020 sec between consecutive cameras.
-To record video turn on live preview using Cmd('LiveViewWnd_Show') and
user Cmd('StartRecord') and Cmd('StopRecord').

Image Download:
-Download is affected by Transfer mode (in app) and session settings.
-Transfer mode is set via the main app to: PC & Camera | Camera only, if
set to Camera only some session settings will be ignored. Set it to PC
& Camera and use session setting "deletefileaftertransfer" if needed.
-session setting "filenametemplate" works only if "useoriginalfilename" is
disabled, and it is applied to downloaded files only, not camera files.
It supports many useful [tags], eg: [Date yyyy-MM-dd], [Time hh-mm-ss],
[Date yyyy-MM-dd-hh-mm-ss], [Exif.Photo.ExposureTime],
[Exif.Photo.FNumber], [Exif.Photo.ISOSpeedRatings], etc
(for a full list go to: Session>Edit Current Session>File Name Template)
-"filenametemplate" can be set when calling the Capture method and applies
to all connected cameras. To distinguish cameras use [Camera Name] or
[Camera Counter 4 digit] tags in the template.
-"folder" does not support [tags], instead use "" in "filenametemplate".
-Manual download of files from the camera can only be done via the app.

C = CameraController; %initialise
C.session.folder = 'C:\DSLR'; %download folder
C.session.filenametemplate = '[Camera Name][Date yyyy-MM-dd-hh-mm-ss]'; = 3200; %camera settings = 5.6; = 1/200;
C.Capture %capture
C.lastfile %last filename

Serge 2018-2024
Note: I am not a developer of digiCamControl app, only this wrapper.

Cite As

Serge (2024). CameraController (, GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2018a
Compatible with R2012a and later releases
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Versions that use the GitHub default branch cannot be downloaded

Version Published Release Notes



See release notes for this release on GitHub:


Bug fixes


-fixed multiple camera support
-improved multiple camera example


-webserver IP can include a port number (default: 'localhost:5513')
-capture "lag" now a property rather then input to Capture method
-fixed error with duplicate fields on Nikon
-debug property no longer hidden


Just comments changes

bunch of small changes and fixes
Now source is on GitHub.
forgot the file

-Support a remote http server
-Better error handling
-Allow commas in filenames
-Minor changes and better help

Fixed issue with Capture method ignoring file and time input.
Updated description and focus stacking example.

Added Webserver support.
Many other small changes.

Improved support for Nikon, by allowing field "active_d-lighting" as "active_d_lighting"

forgot to update code
-update to digiCamControl
-setting fnumber should work properly now
-many minor changes

A bit of everything, mostly help.

Improved the "Capture" method.
A little bit of everything

Fixed Do method
Updated description
Changed Do method, other minor changes

update title
Requirements modified

update description
Added a hack to run Do commands by assigning to the Do property

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.