IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Langage Delphi Discussion :

Capture video avec AVICAP32.dll


Sujet :

Langage Delphi

  1. #1
    Membre habitué
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Mai 2002
    Messages
    272
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 49
    Localisation : France, Haut Rhin (Alsace)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mai 2002
    Messages : 272
    Points : 164
    Points
    164
    Par défaut Capture video avec AVICAP32.dll
    Bonjour,

    Je debute sous Delphi et j'essai de porter un programme ecrit en C sous FreeBSD dessus.

    Voici le source:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
     
    unit Video;
     
    interface
     
    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;
     
    type
      TFormulaire = class(TForm)
        Bouton: TButton;
        Log: TMemo;
        procedure BoutonClick(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;
     
    var
      Formulaire: TFormulaire;
      fenetre : tHandle;
      fDevice: integer;
      DeviceName: array[0..80] of Char;
      DeviceVersion: array[0..100] of Char;
      Resultat : Boolean;
      fCaptureDriverName: string;
     
    implementation
       function capCreateCaptureWindow ( lpszWindowName : PChar; dwStyle : DWord; x, y : Integer; nWidth, nHeight : Integer; hwndParent : THandle; nID : Integer ) : THandle; stdcall; external 'AVICAP32.dll';
       function capGetDriverDescription ( wDriverIndex : DWord; lpszName : PChar; cbName : Integer; lpszVer : PChar; cbVer : Integer ) : Boolean; stdcall; external 'AVICAP32.dll';
     
    {$R *.dfm}
     
    procedure TFormulaire.BoutonClick(Sender: TObject);
    var
       fenetre: hwnd;
    begin
       fenetre := capCreateCaptureWindow(PChar(''), WS_CHILD or WS_VISIBLE or WS_DISABLED, 0, 0, 320, 200, Handle, 0);
    end;
     
    end.
    La ligne qui me pose probleme est:

    fenetre := capCreateCaptureWindow(PChar(''), WS_CHILD or WS_VISIBLE or WS_DISABLED, 0, 0, 320, 200, Handle, 0);
    end;


    Quand je la met, au lieu de lancer ma Form classique, Delphi me renvoi sur Projet_Video dont voici le source

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
     
    program Projet_Video;
     
    uses
      Forms,
      Video in 'Video.pas' {Formulaire};
     
    {$R *.res}
     
    begin
      Application.Initialize;
      Application.CreateForm(TFormulaire, Formulaire);
      Application.Run;
    end.
    Avec une fleche sur le begin

    D'ou vient le probleme ?

    Merci par avance de vos reponses !

  2. #2
    Membre du Club
    Inscrit en
    Mai 2005
    Messages
    111
    Détails du profil
    Informations forums :
    Inscription : Mai 2005
    Messages : 111
    Points : 49
    Points
    49
    Par défaut
    remplace capCreateCaptureWindow par capCreateCaptureWindowA

  3. #3
    Membre du Club
    Inscrit en
    Mai 2005
    Messages
    111
    Détails du profil
    Informations forums :
    Inscription : Mai 2005
    Messages : 111
    Points : 49
    Points
    49
    Par défaut
    et il fait quoi ton programme???

  4. #4
    Membre habitué
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Mai 2002
    Messages
    272
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 49
    Localisation : France, Haut Rhin (Alsace)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mai 2002
    Messages : 272
    Points : 164
    Points
    164
    Par défaut Erreur
    Re bonjour,

    avec

    fenetre := capCreateCaptureWindowA(PChar(''), WS_CHILD or WS_VISIBLE or WS_DISABLED, 0, 0, 320, 200, Handle, 0);

    J'ai l'erreur

    [Error] Video.pas(39): Undeclared identifier: 'capCreateCaptureWindowA'

    En fait mon programme ne fait rien pour l'instant, mais je l'ecris ligne par ligne et j'essai de resoudre mon probleme a la ligne

    fenetre := capCreateCaptureWindow(PChar(''), WS_CHILD or WS_VISIBLE or WS_DISABLED, 0, 0, 320, 200, Handle, 0);

    avant d'aller plus loin.

    Merci par avance !

  5. #5
    Membre du Club
    Inscrit en
    Mai 2005
    Messages
    111
    Détails du profil
    Informations forums :
    Inscription : Mai 2005
    Messages : 111
    Points : 49
    Points
    49
    Par défaut
    c'est parceque tu n'as pas changé le ligne
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
       function capCreateCaptureWindow ( lpszWindowName : PChar; dwStyle : DWord; x, y : Integer; nWidth, nHeight : Integer; hwndParent : THandle; nID : Integer ) : THandle; stdcall; external 'AVICAP32.dll';
    en:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
       function capCreateCaptureWindowA ( lpszWindowName : PChar; dwStyle : DWord; x, y : Integer; nWidth, nHeight : Integer; hwndParent : THandle; nID : Integer ) : THandle; stdcall; external 'AVICAP32.dll';

  6. #6
    Membre du Club
    Inscrit en
    Mai 2005
    Messages
    111
    Détails du profil
    Informations forums :
    Inscription : Mai 2005
    Messages : 111
    Points : 49
    Points
    49
    Par défaut
    c'est parceque tu n'as pas changé la ligne
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
       function capCreateCaptureWindow ( lpszWindowName : PChar; dwStyle : DWord; x, y : Integer; nWidth, nHeight : Integer; hwndParent : THandle; nID : Integer ) : THandle; stdcall; external 'AVICAP32.dll';
    en:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
       function capCreateCaptureWindowA ( lpszWindowName : PChar; dwStyle : DWord; x, y : Integer; nWidth, nHeight : Integer; hwndParent : THandle; nID : Integer ) : THandle; stdcall; external 'AVICAP32.dll';

  7. #7
    Membre régulier
    Profil pro
    Inscrit en
    Septembre 2004
    Messages
    108
    Détails du profil
    Informations personnelles :
    Âge : 45
    Localisation : France

    Informations forums :
    Inscription : Septembre 2004
    Messages : 108
    Points : 89
    Points
    89
    Par défaut
    salut,

    J'ai regarder dans AviCaptura.pas qui est sensé fonctionner:
    cette fonction est declarée avant la partie implementation.c'est a dire:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    unit AviCaptura.pas;
     
    interface
     
    uses
      windows, MMsystem, Message;
     
    //[...]
     
       function capCreateCaptureWindow ( lpszWindowName : PChar; dwStyle : DWord; x, y : Integer; nWidth, nHeight : Integer; hwndParent : THandle; nID : Integer ) : THandle; stdcall;
     
    implemantation
    function capCreateCaptureWindow ; external AVICAP32 name 'capCreateCaptureWindowA';
    Tu peut me dire si après tu a des problemes lors de la connection dau driver (chez moi ca plante et je ne sais pas pourquoi - d'ailleurs si qq'un a une idée...)

  8. #8
    Membre régulier
    Profil pro
    Inscrit en
    Septembre 2004
    Messages
    108
    Détails du profil
    Informations personnelles :
    Âge : 45
    Localisation : France

    Informations forums :
    Inscription : Septembre 2004
    Messages : 108
    Points : 89
    Points
    89
    Par défaut
    Youps!

    Il faut ajouter en plus
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    const
      AVICAP32 = 'AVICAP32.dll';
    ...

  9. #9
    Membre du Club
    Inscrit en
    Mai 2005
    Messages
    111
    Détails du profil
    Informations forums :
    Inscription : Mai 2005
    Messages : 111
    Points : 49
    Points
    49
    Par défaut
    oui j'ai oublié de vous dire qu"il faut déclarer les fonctions dans la partie implémentaion . voila tous le code il fonctionne sans probleme mais je sais pa qu'est ce qu'il fait:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
     
    unit Unit1;
     
    interface
     
    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;
     
    type
      TForm1 = class(TForm)
        Button1: TButton;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;
       function capCreateCaptureWindowA ( lpszWindowName : PChar; dwStyle : DWord; x, y : Integer; nWidth, nHeight : Integer; hwndParent : THandle; nID : Integer ) : THandle; stdcall; external 'AVICAP32.dll';
       function capGetDriverDescription ( wDriverIndex : DWord; lpszName : PChar; cbName : Integer; lpszVer : PChar; cbVer : Integer ) : Boolean; stdcall; external 'AVICAP32.dll';
     
    var
      Form1: TForm1;
      fenetre : tHandle;
      fDevice: integer;
      DeviceName: array[0..80] of Char;
      DeviceVersion: array[0..100] of Char;
      Resultat : Boolean;
      fCaptureDriverName: string;
     
    implementation
     
    {$R *.dfm}
     
    procedure TForm1.Button1Click(Sender: TObject);
    var
       fenetre: hwnd;
    begin
       fenetre := capCreateCaptureWindowA(PChar(''), WS_CHILD or WS_VISIBLE or WS_DISABLED, 0, 0, 320, 200, Handle, 0);
    end;
     
    end.

  10. #10
    Membre habitué
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Mai 2002
    Messages
    272
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 49
    Localisation : France, Haut Rhin (Alsace)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mai 2002
    Messages : 272
    Points : 164
    Points
    164
    Par défaut Ce qu'elle fait ?
    Bonjour et merci pour tout !

    Ce que ce programme fait ? Pour l'instant pas grand chose, il prepare simplement une fenetre ou s'affichera les images issues d'une camera.

    Merci encore !!!

  11. #11
    Membre expert
    Avatar de Bestiol
    Profil pro
    Inscrit en
    Mai 2002
    Messages
    1 515
    Détails du profil
    Informations personnelles :
    Âge : 37
    Localisation : France, Paris (Île de France)

    Informations forums :
    Inscription : Mai 2002
    Messages : 1 515
    Points : 3 894
    Points
    3 894
    Par défaut
    Si ton problème est résolu, n'oublie pas de cliquer sur le bouton en bas à gauche
    Mea est trop forte, elle flotte : mea coule pas !

    Basically this boot sector (Win95) code is 32 bit extension for a 16 bit patch to an 8 bit boot sector originally coded for a 4 bit microprocessor, written by a 2 bit company, that can't stand 1 bit of competition.

    olance.developpez.com
    Servez-vous, profitez, abusez de la FAQ Delphi !!

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. problème avec CapGetDriverDescriptionA Lib "avicap32.dll"
    Par Mario Rousson dans le forum VB.NET
    Réponses: 0
    Dernier message: 18/12/2013, 04h11
  2. Capture Video avec la classe AviWriter
    Par MeryemeBel dans le forum C#
    Réponses: 1
    Dernier message: 02/03/2011, 22h13
  3. capture de video avec avicap32.dll
    Par vinse dans le forum Débuter
    Réponses: 5
    Dernier message: 07/12/2008, 12h25
  4. Capture video en mode texte avec DevC++
    Par Mercenary Developer dans le forum Dev-C++
    Réponses: 3
    Dernier message: 03/10/2006, 15h05

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo