Git Product home page Git Product logo

edsdk-python's Introduction

edsdk-python

Python wrapper for Canon EOS Digital Software Development Kit, aka EDSDK.

Currently, it supports Windows only. But it shouldn't be difficult to adapt it for macOS.

How to build

Obtain the EDSDK from Canon

Before you can use this library you need to obtain the EDSDK library from Canon. You can do so via their developers program:

Once you were granted access - this may take a few days - download the latest version of their library.

Copy the EDSDK Headers and Libraries

You should now have access to a zip file containing the file you need to build this library.

Unzip the file and copy the following folders inside the dependencies folder of this project:

  1. EDSDK - Containing headers and 32-bit libraries (we only use the headers!)
  2. EDSDK_64 - Containing 64-bit version of the .lib and .dlls (which we do use!)

Your dependencies folder structure should now look like this:

dependencies/EDSDK/Header/EDSDK.h
dependencies/EDSDK/Header/EDSDKErrors.h
dependencies/EDSDK/Header/EDSDKTypes.h

dependencies/EDSDK_64/Dll/EDSDK.dll
dependencies/EDSDK_64/Dll/EdsImage.dll

dependencies/EDSDK_64/Library/EDSDK.lib

Any additional files aren't needed, but won't hurt either in case you copied the entire folders.

Modify EDSDKTypes.h

This file contains an enum definition, called Unknown, which collides with a DEFINE in the Windows.h header.

Therefore needs to be renamed.

typedef enum
{
    Unknown   = 0x00000000,
    Jpeg      = 0x3801,
    CR2       = 0xB103,
    MP4       = 0xB982,
    CR3       = 0xB108,
    HEIF_CODE = 0xB10B,
} EdsObjectFormat;

You can comment out Unknown or rename it to UNKNOWN (or whatever you want) or it won't compile on Windows.

Build the library

Run:

pip install .

Throubleshooting

C2365: 'Unknown': redefinition; previous definition was 'enumerator' : go to the section Modify EDSDKTypes.h and follow the instructions.

edsdk-python's People

Contributors

jiloc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

edsdk-python's Issues

save_image.py error...

Thank you for your edsdk-python code.

I am trying this "save_image.py"

There are two problem.

(1) 'PropertyEvent' is not defined

def callback_property(event: PropertyEvent, property_id: PropID, parameter: int) -> int:

NameError: name 'PropertyEvent' is not defined

(2) result is None, None

is it right?

Computer is connected to the EOS Canon camera with USB.

image

There are problem sometimes in take photo

I developed a software that takes photos regularly with Python. I did all the steps in your descriptions. The program works smoothly. But in rare cases "edsdk.SendCommand(cam, CameraCommand.TakePicture, 0)" stops the project running while this command is executed. For example, if the command to take 200 photos per day is given, the program will crash once or twice and must be restarted.

What could be the reason and how can I solve it?

save_image.py dosen't work

Traceback (most recent call last):
File "C:\Users\33Lab\Documents\Dev\Graduation_project\edsdk-python\examples\save_image.py", line 5, in
import edsdk
File "C:\Users\33Lab\Documents\Dev\Graduation_project\edsdk-python\edsdk_init_.py", line 1, in
from edsdk.api import *
ModuleNotFoundError: No module named 'edsdk.api'

Process finished with exit code 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.