Affichage des résultats 1 à 20 sur 44
Discussion: ED-SDK 2.7 En Delphi
-
14/01/2010, 08h57 #1
- Inscription
- janvier 2008
- Localisation
- France
- Messages
- 26
- Boîtier
- Canon EOS 20D ~ EOS 7D
- Objectif(s)
- 10-22 f/3.5-4.5 ~ 50 f/1.4 ~ Sigma 18-50 f/2.8 ~ 100 f/2.8 Macro ~ 100-400 f/4.5-5.6
ED-SDK 2.7 En Delphi
Bonjour à tous,
A terme je souhaite développer une appli pour l'astrophoto qui me permette de commander un Reflex Canon, mais pour le moment j'essaye déjà de maitriser les commandes de base.
Petite difficulté supplémentaire, mon langage de prédilection est le Delphi, abandonné par Canon depuis la version 2.5 du SDK.
J'ai donc commencé par télécharger toutes les version disponible du SDK, pour trouver les dernières sources en Delphi (SDK 2.4). J'ai ensuite essayé d'intégrer les différences avec le SDK le plus récent pour enfin faire mon propre programme de test.
Les bases fonctionnent, mais pas beaucoup plus.
J'arrive à charger le SDK, trouver le reflex, m'y connecter, récupérer ses règlages, les changer, prendre une photo et la télécharger (ce qui n'est déjà pas mal).
Je bloque pour ce qui est de la prise Bulb et du LiveView. Bulb testé avec un 20D et un 7D, LiveView testé avec un 7D.
Bulb
Lorsque j'envoie kEdsCameraCommand_BulbStart
7D : Erreur #44313 (0xAD19) - non documentée
20D : Erreur #7 ( EDS_ERR_NOT_SUPPORTED )
LiveView
Lorsque j'appelle EdsDownloadEvfImage
7D : Erreur de pointeur(là je pense peut-être trouver un jour une solution) + Erreur #97 (0x61 EDS_ERR_INVALID_HANDLE - ce qui me parait logique)
Ces deux problème (Buld Et Liveview sont à prioris tottalement indépendant, mais si vous avez des pistes pour l'un où l'autre, je suis preneur.
Mes sources (inutilisable sans le SDK 2.7 bien sur) : CCCp 0.0.9.rar (216ko)
Juste pour comprendre comment s'articule mes sources : J'ai créé un Objet TCanonCamera pour faciliter l'utilisation du SDK. Les Méthodes de TCanonCamera se chargent d'appeler les méthodes du SDK "qui vont bien".
Je suis ouvert à toute suggestion qui me permetrai d'avancer sur ce projet.
Ah et si ces sources vous sont utiles, je vous en prie, servez-vous.
Dernière modification par pixelk ; 14/01/2010 à 09h00.
-
14/01/2010, 10h39 #2
- Inscription
- janvier 2008
- Localisation
- France
- Messages
- 26
- Boîtier
- Canon EOS 20D ~ EOS 7D
- Objectif(s)
- 10-22 f/3.5-4.5 ~ 50 f/1.4 ~ Sigma 18-50 f/2.8 ~ 100 f/2.8 Macro ~ 100-400 f/4.5-5.6
J'ai avancé d'une ligne pour le LiveView \o/
J'ai trouvé le format d'appel correct de EdsDownloadEvfImage
et maintenant je bloque sur EvdGetPointer
Source : CCCp 0.0.11 (35ko)
-
15/01/2010, 21h43 #3
- Inscription
- mars 2008
- Localisation
- France
- Messages
- 31
- Boîtier
- EOS 40D
- Objectif(s)
- Tamron 17-50 f:2,8 100 mm macro 70-200mm f:4 L
Bonjour PixelK,
Tu as une bonne idée, je m'intéresse également à l'astro...
Voici comment je m'en suis sorti (après de nombreux tests, il y a peut être une autre solution plus performante...Je n'ai pas creusé) :
1) Récupération des données Live View comme indiqué dans le SDK avec :
- EdsCreateMemoryStream(0, FluxLiveview)
- EdsCreateEvfImageRef(FluxLiveView, EvfImage)
- EdsDownloadEvfImage((Camera, EvfImage)
2) Récupération de l'image Live View et de sa taille avec :
- EdsGetPointer(FluxLiveView, ImageData)
- EdsGetLength(FluxLiveView, ImageSize)
Puis envoie de l'image dans un buffer en mémoire avec CopyMemory.
3) Envoie du contenu du buffer dans un JPEG (via un flux)
Note : FluxLiveview, EvfImage, Camera, ImageData sont des pointeurs (déclarés en type Pointer sous Delphi).
-
24/01/2010, 16h03 #4
- Inscription
- janvier 2008
- Localisation
- France
- Messages
- 26
- Boîtier
- Canon EOS 20D ~ EOS 7D
- Objectif(s)
- 10-22 f/3.5-4.5 ~ 50 f/1.4 ~ Sigma 18-50 f/2.8 ~ 100 f/2.8 Macro ~ 100-400 f/4.5-5.6
J'arrive maintenant à faire le EdsDownloadEvfImage et à en lire les propriétés. Par contre je bloque toujours sur la récupération de l'image LiveView. J'ai mis le projet en pause parce que je me suis fait une petite frayeur : au bout de deux heures d'essais de plus en plus infructueux, plus moyen de reprendre le contrôle manuel du 7D, même après l'avoir éteint rallumé !
Heureusement tout est rentré dans l'ordre après avoir sortis la batterie quelques secondes.
Dès que j'ai un peu de courage, je m'y remet.
-
05/04/2010, 22h02 #5
- Inscription
- septembre 2009
- Localisation
- Suisse
- Messages
- 27
- Boîtier
- 5D III, 7D II
- Objectif(s)
- EF-S 10-22, EF-S 15-85, EF 70-200 f/4
-
19/06/2010, 16h11 #6SpirtGuest
Any news about LiveView?
-
19/06/2010, 17h41 #7
- Inscription
- janvier 2008
- Localisation
- France
- Messages
- 26
- Boîtier
- Canon EOS 20D ~ EOS 7D
- Objectif(s)
- 10-22 f/3.5-4.5 ~ 50 f/1.4 ~ Sigma 18-50 f/2.8 ~ 100 f/2.8 Macro ~ 100-400 f/4.5-5.6
Not yet, I postponed this project for the moment.
-
20/06/2010, 06h49 #8SpirtGuest
It's a pity. I am also working on this problem and very need to solve it ASAP. I have a sample on C++ which works with live view and it seems it has pretty easy code realisation.I Don't know why it's still a problem in delphi. EdsDownloadEvfImage still returns EDS_ERR_INVALID_HANDLE. Any help appreciated.
-
20/06/2010, 11h09 #9SpirtGuest
I have solved the problem. Soon I'll give You a code if u need. Just need to order it first.
-
20/06/2010, 11h28 #10
- Inscription
- janvier 2008
- Localisation
- France
- Messages
- 26
- Boîtier
- Canon EOS 20D ~ EOS 7D
- Objectif(s)
- 10-22 f/3.5-4.5 ~ 50 f/1.4 ~ Sigma 18-50 f/2.8 ~ 100 f/2.8 Macro ~ 100-400 f/4.5-5.6
Excellent News !
I'm really interested by your code, thanks in advance.
-
20/06/2010, 14h00 #11SpirtGuest
A little bit early to celebrate. Got another problem. Here is my code :
function TCanonCamera.downloadLiveData(Image:TImage) : Boolean;
var
evfImage : PEdsEvfImageRef;
......
begin
......
stream := nil;
Self.LastError := EdsCreateFileStream(
'LiveData.jpg',kEdsFileCreateDisposition_CreateAlw ays, kEdsAccess_ReadWrite,stream);
if Self.LastError <> EDS_ERR_OK then
Exit;
evfImage:=nil;
Self.LastError := EdsCreateEvfImageRef(stream, evfImage);
if Self.LastError <> EDS_ERR_OK then
begin
EdsRelease(stream);
Exit;
end;
Self.LastError := EdsDownloadEvfImageLiveView(Self.FRef, evfImage^);
if Self.LastError <> EDS_ERR_OK then
begin
EdsRelease(evfImage);
EdsRelease(stream);
Exit;
end;
....
Result := true;
end;
As You can see i redeclared evfImage from EdsEvfImageRef to PEdsEvfImageRef where PEdsEvfImageRef = ^EdsEvfImageRef;
and
function EdsDownloadEvfImageLiveView ( inCameraRef : EdsCameraRef;
inEvfImageRef : PEdsEvfImageRef) : EdsError; stdcall; external edsdk name 'EdsDownloadEvfImage';
It properly saves liveView data to LiveData.jpg, but after exiting this function TCanonCamera.downloadLiveData(Image:TImage) : Boolean; access violation occurs, so I can take only one frame of LiveView data. Still working on it...Dernière modification par Spirt ; 20/06/2010 à 14h13.
-
20/06/2010, 14h56 #12
- Inscription
- janvier 2008
- Localisation
- France
- Messages
- 26
- Boîtier
- Canon EOS 20D ~ EOS 7D
- Objectif(s)
- 10-22 f/3.5-4.5 ~ 50 f/1.4 ~ Sigma 18-50 f/2.8 ~ 100 f/2.8 Macro ~ 100-400 f/4.5-5.6
I seems I'm unable to replicate the download of the liveview image on my 7D (the jpeg file is 0ko and I get the same access violation at the end of downloadLiveData.
Could you please post the full function to a site like Pastebin.com - #1 paste tool since 2002! (it preserves the formating) ?
-
20/06/2010, 15h12 #13SpirtGuest
Somethimes I also get jpeg file is 0k after access violations. Don't know what it depends on. Try switch off/on your camera.
Tomorrow I'll give your all code. I am in a hurry.
-
20/06/2010, 15h52 #14
- Inscription
- janvier 2008
- Localisation
- France
- Messages
- 26
- Boîtier
- Canon EOS 20D ~ EOS 7D
- Objectif(s)
- 10-22 f/3.5-4.5 ~ 50 f/1.4 ~ Sigma 18-50 f/2.8 ~ 100 f/2.8 Macro ~ 100-400 f/4.5-5.6
Here is my version of the fonction, no error and valid liveview jpeg : Delphi | function TCanonCamera.Download - Pk - 25KXhhQw - Pastebin.com
-
20/06/2010, 16h40 #15SpirtGuest
Dernière modification par Spirt ; 20/06/2010 à 16h45.
-
20/06/2010, 16h59 #16
- Inscription
- janvier 2008
- Localisation
- France
- Messages
- 26
- Boîtier
- Canon EOS 20D ~ EOS 7D
- Objectif(s)
- 10-22 f/3.5-4.5 ~ 50 f/1.4 ~ Sigma 18-50 f/2.8 ~ 100 f/2.8 Macro ~ 100-400 f/4.5-5.6
Here is my full Source CCCp 0.0.17.
Works fine with my 7D, on battery or on AC power, on two different computers, usin SDK 2.7 (I know that 2.8 is out, but for now, 2.7 works)
-
20/06/2010, 17h23 #17SpirtGuest
It works! Thank You very much!!!
-
20/06/2010, 17h29 #18
- Inscription
- janvier 2008
- Localisation
- France
- Messages
- 26
- Boîtier
- Canon EOS 20D ~ EOS 7D
- Objectif(s)
- 10-22 f/3.5-4.5 ~ 50 f/1.4 ~ Sigma 18-50 f/2.8 ~ 100 f/2.8 Macro ~ 100-400 f/4.5-5.6
Thank you Spirt for publishing your findings !
Now, the next level, get the liveview in a memory stream, to be able to display it with a high refresh rate.
I will also try to drive the focus motor in LiveView.
I'm working on it right now.
-
20/06/2010, 22h35 #19
- Inscription
- janvier 2008
- Localisation
- France
- Messages
- 26
- Boîtier
- Canon EOS 20D ~ EOS 7D
- Objectif(s)
- 10-22 f/3.5-4.5 ~ 50 f/1.4 ~ Sigma 18-50 f/2.8 ~ 100 f/2.8 Macro ~ 100-400 f/4.5-5.6
An here is a very dirty state (no time to clean the source right now) with working focus control and LiveView Zoom (but still no LiveView directly to memory stream) :
CCCp 0.0.20 BETA
-
21/06/2010, 14h11 #20SpirtGuest
Bonjour pixelk. What do You meant under LiveView zoom? I have a manual zoom on my EOS 1000D and when I a adjust it liveview picture is also zooming...
By the way I compared my yesterday's unworking code with your .17 version code (I mean DownloadLiveView function) and didn't find any serious differences except of variables names. So I really don't understand why it didn't work.
Soon I'll also try to finish with liveView MemoryStream data send. If You will make it first please post the code here. Thank You
Informations de la discussion
Utilisateur(s) sur cette discussion
Il y a actuellement 1 utilisateur(s) naviguant sur cette discussion. (0 utilisateur(s) et 1 invité(s))