dimensional-de / napi-canon-cameras Goto Github PK
View Code? Open in Web Editor NEWNode AddOn Api module for Canon cameras
License: GNU General Public License v3.0
Node AddOn Api module for Canon cameras
License: GNU General Public License v3.0
Refactor Camera.downloadLiveViewImage()
return value into a LiveViewImage
object and add methods to provide access to EVF data.
Hi, is it possible to build this using on an Apple Silicon machine, maybe using Rosetta? I have tried to run npm run package
but then I get this error:
Error: No native build was found for platform=darwin arch=arm64 runtime=node abi=93 uv=1 armv=8 libc=glibc node=16.19.1
loaded from: /Developer/Experiments/napi-canon-cameras-main
Thanks in advance for any advice.
Hey,
first of all great work with this library (truly a lifesaver). I adapted the code and the node-gyp configuration so it compiles on mac os. But for some reason the events from the connected camera are not executed (event handler etc are correctly initialized). I'm not that experienced with c++ unfortunately. Do you have any idea what the issue here could be? If there is nothing you can do for me it's totally fine and you can close this issue, just wanted to check if you have maybe some experience with EDSDK on mac os.
Do you know there is any modification to SX430 IS?
Hi !
First many thanks for this library ๐ Very useful.
And this issue is not an issue with the implementation of the library.
Example I found didn't really showed how to use shutterSpeed properties.
At end of day, I succeed to get it work
camera.setProperties(
{
[ CameraProperty.ID.Tv ]: 0x10,
}
);
0x10
value has been found from @dimensional/napi-canon-cameras/src/library/shutter-speed.cc
Before finding this solution, I've tried many other ways.
Usually resulting in :
Unable to setProperties
Error: EDSDK - INVALID_DEVICEPROP_VALUE
Unable to setProperties
TypeError: Argument 0 must be a number or string.
So Im wondering, how would you use the ShutterSpeed
class make to code more readable than 0x10
?
Thanks!
Hello, and thank you for providing the wrapper!
I'm currently using PiOS. Could you please confirm if it's compatible with the Linux ESDK?
I'm having trouble creating my package.
When I run npm run package, I encounter the following error:
`
@dimensional/[email protected] package
npm run prebuild && node helpers/create-tgz.js
@dimensional/[email protected] prebuild
run-script-os
run-script-os was unable to execute the script 'prebuild'
npm ERR! code 254
npm ERR! path /home/dev/Documents/napi-canon-cameras-main
npm ERR! command failed
npm ERR! command sh -c run-script-os
npm ERR! A complete log of this run can be found in:
npm ERR! /home/dev/.npm/_logs/2024-03-20T10_40_05_834Z-debug.log
npm ERR! code 254
npm ERR! path /home/dev/Documents/napi-canon-cameras-main
npm ERR! command failed
npm ERR! command sh -c npm run prebuild && node helpers/create-tgz.js
npm ERR! A complete log of this run can be found in:
npm ERR! /home/dev/.npm/_logs/2024-03-20T10_40_05_875Z-debug.log
`
Please, could you help me troubleshoot this issue?
After liveview process if I am using take-picture server is getting abruptly shut down.(I am having two different APIs for liveview and capture using express js. So, if liveview api is called first and then take picture, server is getting stoped without any error. Though I can hear a shutter sound before the server shuts down. Also tried camera.disconnect after liveview process is finished.)
Can you please help what might be the issue.
The ForLabel function in aperture.cc & shutter-speed.cc returns the first value that matches the label. Entries affected by the 'Exposure Level Increment' custom function all have 2 values mapped to the same label in no particular order. The means switching the Exposure Level Increment between 1/2 and 1/3, won't solve the issue, just change which values are wrong. Some values returned by this function will always be incorrect unless it references the camera's Exposure Level Increment to choose between the duplicate mappings.
Exposure Level Increment:
Property ID: 9
Specifier: 257
Values:
May I ask how to increase image resolution in LiveView
Hi,
First of all - great job! The code is like a work of art. Outstanding!
On Windows, compilation and installation was a pleasure. So rarely I have had the opportunity to observe so silky smooth process.
The examples show that everything works as it should. Camera connects, taking pictures, processing live view...
I also tried on MacOS (10.14 and 10.15). Well, and again - even this platform was considered as a target - great! The installation process was less smooth and required a few extra steps, but it worked! However, during startup, the program got stuck, I presume, on linking EDSDK framework or init process.... hard to say more... in any case, the question is, did you successfully use the MacOS version of your libs? Second question, are you planning to add EVF zoom data (rectangle/position)?
Used tech: Build - Node 16.15.0 (win) / 16.14.2 (mac), Runtime - Electron 20.0.2
Thanks again!
Greg
kEdsPropID_Tv has two entries in it's map for 1/25:
{0x5C, (1.0 / 25)},
{0x5D, (1.0 / 25)},
The EDSDK13.14.40 API Programming Reference lists 0x5D as1/25, however 0x5C should be mapped to 1/20 (with a 1/2 Exposure Increment, as opposed to the 1/20 mapping 0x5B, which is for the 1/3 Exposure Increment)
This is related to #2 and results in the same error, but that is a very generic error and I have found that my problem seems to require a different solution from what was posed in that issue.
The error comes up when you do npm run package
and is the result of the update-stubs.js
script:
> @dimensional/[email protected] _update:stubs D:\Programming-School\napi-canon-cameras
> node ./helpers/update-stubs.js
internal/modules/cjs/loader.js:1122
return process.dlopen(module, path.toNamespacedPath(filename));
^
Error: A dynamic link library (DLL) initialization routine failed.
\\?\D:\Programming-School\napi-canon-cameras\prebuilds\win32-x64\node.napi.node
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1122:18)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at load (D:\Programming-School\napi-canon-cameras\node_modules\node-gyp-build\index.js:21:10)
at Object.<anonymous> (D:\Programming-School\napi-canon-cameras\camera-api.js:1:40)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
I followed the guide here to setup LLDB for running node_api addons and was able to isolate the error as originating from line 738 in 'labels.cc.' The unordered list being created here triggers an error when it tries to run the constructor for the list items. I tried commenting out the initialization items and that got past the error:
std::unordered_map<int, LabelMap> Labels::Option = {
// {kEdsPropID_AEMode, AEMode},
// {kEdsPropID_AEModeSelect, AEModeSelect},
// {kEdsPropID_AFMode, AFMode},
// {kEdsPropID_BatteryQuality, BatteryQuality},
// {kEdsPropID_Bracket, Bracket},
// {kEdsPropID_ColorSpace, ColorSpace},
// {kEdsPropID_DC_Strobe, DCStrobe},
// {kEdsPropID_DriveMode, DriveMode},
// {kEdsPropID_Evf_AFMode, EvfAFMode},
// {kEdsPropID_Evf_HistogramStatus, EvfHistogramStatus},
// {kEdsPropID_Evf_OutputDevice, EvfOutputDevice},
// {kEdsPropID_Evf_WhiteBalance, WhiteBalance},
// {kEdsPropID_Evf_Zoom, EvfZoom},
// {kEdsPropID_ImageQuality, ImageQuality},
// {kEdsPropID_LensBarrelStatus, LensBarrelStatus},
// {kEdsPropID_LensStatus, LensStatus},
// {kEdsPropID_MeteringMode, MeteringMode},
// {kEdsPropID_MirrorLockUpState, MirrorUpStatus},
// {kEdsPropID_MovieParam, MovieQuality},
// {kEdsPropID_NoiseReduction, NoiseReduction},
// {kEdsPropID_RedEye, RedEye},
// {kEdsPropID_Record, Record},
// {kEdsPropID_SaveTo, SaveTo},
// {kEdsPropID_WhiteBalance, WhiteBalance}
};
I am not sure exactly what is wrong here. I will keep investigating to see if I can get to the bottom of these initializers and why they are failing but if something jumps out at you lmk!
Here is my npm version
info:
{
'@dimensional/napi-canon-cameras': '0.1.0',
npm: '6.14.11',
ares: '1.16.1',
brotli: '1.0.9',
cldr: '37.0',
icu: '67.1',
llhttp: '2.1.3',
modules: '83',
napi: '7',
nghttp2: '1.41.0',
node: '14.16.0',
openssl: '1.1.1j',
tz: '2020a',
unicode: '13.0',
uv: '1.40.0',
v8: '8.4.371.19-node.18',
zlib: '1.2.11'
}
Hi Thomas,
nice project!!
I was trying to do: npm run package
and I ran into an error, see below:
Any suggestions?
Thanks in advance,
Sitan van Sluis
Using:
Windows 10, Visual Studio Community 2019
EDSDKv131300W
npm version
{
'@dimensional/napi-canon-cameras': '0.1.0',
npm: '7.6.2',
node: '14.16.0',
v8: '8.4.371.19-node.18',
uv: '1.40.0',
zlib: '1.2.11',
brotli: '1.0.9',
ares: '1.16.1',
modules: '83',
nghttp2: '1.41.0',
napi: '7',
llhttp: '2.1.3',
openssl: '1.1.1j',
cldr: '37.0',
icu: '67.1',
tz: '2020a',
unicode: '13.0'
}
@dimensional/[email protected] build:stubs
npm run _update:stubs && npm run _build:stubs:types && npm run _build:es2015 && npm run _build:esm && npm run _build:umd && npm run _build:umd:min
@dimensional/[email protected] _update:stubs
node ./helpers/update-stubs.js
internal/modules/cjs/loader.js:1122
return process.dlopen(module, path.toNamespacedPath(filename));
^
Error: Een initialisatieroutine van de dynamic link library (DLL-bestand) is mislukt.
\?\C:\Users\info\napi-canon-cameras-master\prebuilds\win32-x64\node.napi.node
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1122:18)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at load (C:\Users\info\napi-canon-cameras-master\node_modules\node-gyp-build\index.js:21:10)
at Object. (C:\Users\info\napi-canon-cameras-master\camera-api.js:1:40)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
npm ERR! code 3221225477
npm ERR! path C:\Users\info\napi-canon-cameras-master
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node ./helpers/update-stubs.js
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\info\AppData\Local\npm-cache_logs\2021-04-22T14_18_28_264Z-debug.log
npm ERR! code 3221225477
npm ERR! path C:\Users\info\napi-canon-cameras-master
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c npm run _update:stubs && npm run _build:stubs:types && npm run _build:es2015 && npm run _build:esm && npm run _build:umd && npm run _build:umd:min
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\info\AppData\Local\npm-cache_logs\2021-04-22T14_18_28_291Z-debug.log
npm ERR! code 3221225477
npm ERR! path C:\Users\info\napi-canon-cameras-master
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c npm run prebuild:ia32 && npm run prebuild:x64 && npm run build:stubs
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\info\AppData\Local\npm-cache_logs\2021-04-22T14_18_28_312Z-debug.log
npm ERR! code 3221225477
npm ERR! path C:\Users\info\napi-canon-cameras-master
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c npm run prebuild && node helpers/create-tgz.js
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\info\AppData\Local\npm-cache_logs\2021-04-22T14_18_28_333Z-debug.log
/c/Program Files/nodejs/npm: line 37: 1861 Segmentation fault "$NODE_EXE" "$NPM_CLI_JS" "$@"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.