GithubHelp home page GithubHelp logo

How did you do this? about mtplvcap HOT 4 CLOSED

korpe1 avatar korpe1 commented on July 17, 2024
How did you do this?

from mtplvcap.

Comments (4)

korpe1 avatar korpe1 commented on July 17, 2024 1

I'm not sure, but I think some reverse-engineering like sniffing API calls between the official tool and camera is possible because MTP is well-known especially in Windows world.

Okay, thank you for your answers :) Have a nice weekend!

from mtplvcap.

puhitaku avatar puhitaku commented on July 17, 2024

Now it's time to unveil the secret gem ... which is not that secret haha
The source I found and learned so many things from is listed in the Credit section of the readme.

go-mtpfs

mtplvcap started from forking go-mtpfs which implements MTP communication over famous libusb. This software is awesome not only for implementing MTP, but having const.go that contains so many consts extracted from libmtp. munge.py converts a header in libmtp into a Go code.

So why consts are awesome? Please take a look at this line for example. OC stands for "operation code" so you can make an operation call with this enum. You'll easily guess what's going to happen by to call OC_NIKON_StartLiveView!

MTP devices have "properties" that can be read and written. The ID of them is called DPC (device property code) and these are also listed in the same file.

So the primitive things mtplvcap do here are: call commands and read/write properties described in const.go. I did some guessing game here with some trivial try-and-errors to open the shutter and take LV frames.

digiCamControl

Simple operations like opening the shutter and fetching the frame stream were done pretty easily. Painful parts were left next; 1. to control so many knobs on the DSLR like exposure and f-value. 2. to handle the difference of so many models ranging from 2000s to 2020s.

Implementing all of them without knowledge was impossible. So, I looked for other implementations that do the things. One of them was digiCamControl that covers massive number of DSLRs so I learned so many from here.

Experiment and contribution

All I had was a Nikon D5300 then so I went to a camera store to test my program. Luckily, a store clerk allowed me to do so (not knowing I'm doing some dev ... I never lied, but I said "I want to try tethered shot" lol). The confirmed model list in readme with my name other than D5300 was all tested in the store.

And of course, mtplvcap would have never grown like today without contributions from all over the world. Issue author and I tried so many things so get it working.

from mtplvcap.

korpe1 avatar korpe1 commented on July 17, 2024

digiCamControl

Simple operations like opening the shutter and fetching the frame stream were done pretty easily. Painful parts were left next; 1. to control so many knobs on the DSLR like exposure and f-value. 2. to handle the difference of so many models ranging from 2000s to 2020s.

Implementing all of them without knowledge was impossible. So, I looked for other implementations that do the things. One of them was digiCamControl that covers massive number of DSLRs so I learned so many from here.

How did digiCamControl implemented this propietary protocol without docs?

from mtplvcap.

puhitaku avatar puhitaku commented on July 17, 2024

I'm not sure, but I think some reverse-engineering like sniffing API calls between the official tool and camera is possible because MTP is well-known especially in Windows world.

from mtplvcap.

Related Issues (20)

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.