version 1.3.3 (14.4 KB) by Serge
Controller for supported DSLR cameras via digiCamControl application


Updated Thu, 22 Nov 2018 13:57:28 +0000

From GitHub

View License on GitHub

Controller (v1.3.3) 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 and start digiCamControl v2.1.0 or greater:
2.Enable webserver: File>Settings>Webserver>Enable> RESTART APP
3.Connect one or more cameras using USB cable (or WiFi if supported?).
4.For full programmatic control set camera to (M) and lens to (MF).
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 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"
-digiCamControl issues:
-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 settings
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

Cite As

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

MATLAB Release Compatibility
Created with R2018a
Compatible with R2012a to R2018b
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
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.