Skip to content
hansi raber edited this page Aug 27, 2016 · 5 revisions

EDSDK4J: Canon EOS Digital Software Development Kit EDSDK Java Wrapper

The canon EDSDK is a great library to control pretty much any aspect of your canon SLR camera from any application.

Currently there are some very important limitations you shouldn't forget:

  1. It only works in windows - mac support is painful and currently crashes
  2. We are not allowed to include the required dll's for the SDK, please apply for a download yourself. It might take a few days...
  3. Parts of the code is based on the openframeworks classes for ofxCanonCameraWrapper.

Getting started

First you need to apply and download the EDSK, it might take a few days and you may not be accepted if you are trying to use this for personal use only.

Once you have the download copy the EDSDK folder into this project, you should see this:

edsdk4j
- EDSDK
  - dll
  - Header

After those two steps import the project in eclipse, all the required files are included.

Examples

The examples inside src/gettingstarted should provide a good starting point. You can either use the c-style api directly (example 1), but you won't enjoy this (so look at examples 2, 3, ...) instead :)

Mac Version

There is no working mac version yet. See https://github.com/kritzikratzi/edsdk4j/issues/23 These steps are necessary:

  1. change all occurences of StdCallCallback (StdCallbackLibrary) to Callback (Library)
  2. remove all reference to windows api's. should be easy to find because they make your app crash when you launch :)
  3. remove the dispatch message calls (peekMessage/dispatchMessage/translateMessage)
  4. copy the edsdk framework to /Library/Frameworks or /System/Library/Frameworks
  5. ✓ fiddle with the library loading a bit.
  6. if you would like to use callbacks (e.g. for downloading images) make sure to have some awt window open. calling new Frame().dispose(); seems to be enough to get the nsapplication loop going.
  7. ✓ The -d32 JVM arguments to force 32bit mode doesn't help anymore since JDK 7. The latest edsdk is 64bit mode and needs to be used . good luck :)

Building

Until 2016 the build environment for this project was ant which is now deprecated. You might want to use maven to get more mileage.

Maven

To build the jar file run

mvn package

Ant

The ant build.xml is deprecated and might need some fiddling to get it work again

ant

Testing

JUnit-Tests

Maven

mvn test

JNAErator

JNAErator Maven plugin

<!-- https://mvnrepository.com/artifact/com.nativelibs4java/maven-jnaerator-plugin -->
<dependency>
    <groupId>com.nativelibs4java</groupId>
    <artifactId>maven-jnaerator-plugin</artifactId>
    <version>0.12</version>
</dependency>

History

pre 2010 - who?: Due to the lack of a Canon SLR I currently do not maintain this project. Feel free to fork and play with it! Also: it seems the user yeroc has a newer version than me, you might fork that one instead ...-

2010 kritikratzi (Hansi Raber):

since 2014-08 at github:

2014/2015: Ananta Palani

  • Added most of the missing constants and commands
  • Cleaned and improved the project all around

2016 Wolfgang Fahl: