begin process at 2012 02 12 16:00:01
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

API

 > ENREGISTREMENT WEBCAM FORMATAGE DU NOM ET DE L'EMPLACMENT :)

ENREGISTREMENT WEBCAM FORMATAGE DU NOM ET DE L'EMPLACMENT :)


 Information sur la source

Note :
7,5 / 10 - par 2 personnes
7,50 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :API Niveau :Débutant Date de création :11/02/2005 Vu :6 437

Auteur : fabrice007

Ecrire un message privé
Commentaire sur cette source (6)
Ajouter un commentaire et/ou une note

 Description

Pour l'enregistrement de avi à partir d'une webcam, mais il y a pas de sources exemples pour la gestion du nom du fichier et sa destination, mais aussi que les sources avec le type "capparametre" incompletement defini pose problème. Et comme j'ai bp mais bp galérer pour trouver la solution je poste pour aider les autres :D

GL à tous

Source

  • Private Type TCAPTUREPARMS
  • dwRequestMicroSecPerFrame As Long '// Requested capture rate
  • fMakeUserHitOKToCapture As Long '// Show "Hit OK to cap" dlg?
  • wPercentDropForError As Long '// Give error msg if > (10% default)
  • fYield As Long '// Capture via background task?
  • dwIndexSize As Long '// Max index size in frames (32K default)
  • wChunkGranularity As Long '// Junk chunk granularity (2K default)
  • fUsingDOSMemory As Long '// Use DOS buffers? (obsolete)
  • wNumVideoRequested As Long '// # video buffers, If 0, autocalc
  • fCaptureAudio As Long '// Capture audio?
  • wNumAudioRequested As Long '// # audio buffers, If 0, autocalc
  • vKeyAbort As Long '// Virtual key causing abort
  • fAbortLeftMouse As Long '// Abort on left mouse?
  • fAbortRightMouse As Long '// Abort on right mouse?
  • fLimitEnabled As Long '// Use wTimeLimit?
  • wTimeLimit As Long '// Seconds to capture
  • fMCIControl As Long '// Use MCI video source?
  • fStepMCIDevice As Long '// Step MCI device?
  • dwMCIStartTime As Long '// Time to start in MS
  • dwMCIStopTime As Long '// Time to stop in MS
  • fStepCaptureAt2x As Long '// Perform spatial averaging 2x
  • wStepCaptureAverageFrames As Long '// Temporal average n Frames
  • dwAudioBufferSize As Long '// Size of audio bufs (0 = default)
  • fDisableWriteCache As Long '// Attempt to disable write cache
  • AVStreamMaster As Long '// Which stream controls length?
  • End Type
  • Public Sub Enregistrement()
  • Dim FileName As String
  • Dim heureStr As String
  • Dim dateStr As String
  • frmMain.Shape1.BorderColor = vbRed
  • With CapParms
  • ' voir le message de confirmation
  • .fMakeUserHitOKToCapture = False ' - converts VB Boolean to C BOOL
  • ' pour gestion si trop d image rejeter
  • .wPercentDropForError = 10
  • ' fUsingDOSMemory est obselette
  • .fUsingDOSMemory = False
  • ' The number of video buffers should be enough to get through
  • ' disk seeks and thermal recalibrations
  • .wNumVideoRequested = 32
  • ' abandon sur click gauche
  • .fAbortLeftMouse = -(True)
  • ' abandon sur click droit
  • .fAbortRightMouse = -(True) '- converts VB boolean to C BOOL
  • ' If wChunkGranularity is zero, the granularity will be set to the
  • ' disk sector size.
  • .wChunkGranularity = 0
  • ' default
  • .dwAudioBufferSize = 0
  • ' le caching
  • .fDisableWriteCache = -(True)
  • ' utilisation du MCI
  • .fMCIControl = False
  • .fStepCaptureAt2x = False
  • ' multi-threading
  • .fYield = True
  • ' audio buffers
  • .wNumAudioRequested = 4 '10 est la limit max
  • ' parametre charger a partir du registre
  • .AVStreamMaster = AVSTREAMMASTER_AUDIO
  • ' fixe la taille max de AVI en frames
  • .dwIndexSize = 32000
  • ' les parametre de la video fps,son,timelimit
  • .dwRequestMicroSecPerFrame = 66667
  • .fCaptureAudio = True
  • .fLimitEnabled = True
  • .wTimeLimit = 10
  • End With
  • heureStr = Format(Now, "hh-mm-ss")
  • dateStr = Format(Date, "yyyy-mm-dd")
  • FileName = Module_base.Get_dossier_avi & "BV_" & dateStr & "_" & heureStr & "_1.avi"
  • 'Change le nom par default (c:\capture)
  • SendMessageToRecord hwnd, WM_CAP_FILE_SET_CAPTURE_FILE, 0, ByVal FileName
  • 'Envoie les param de la video
  • SendMessageToRecord hwnd, WM_CAP_SET_SEQUENCE_SETUP, Len(CapParms), CapParms
  • 'Commence la capture
  • SendMessageToRecord hwnd, WM_CAP_SEQUENCE, Len(CapParms), CapParms
  • End Sub
Private Type TCAPTUREPARMS
    dwRequestMicroSecPerFrame As Long       '// Requested capture rate
    fMakeUserHitOKToCapture As Long         '// Show "Hit OK to cap" dlg?
    wPercentDropForError As Long            '// Give error msg if > (10% default)
    fYield As Long                          '// Capture via background task?
    dwIndexSize As Long                     '// Max index size in frames (32K default)
    wChunkGranularity As Long               '// Junk chunk granularity (2K default)
    fUsingDOSMemory As Long                 '// Use DOS buffers? (obsolete)
    wNumVideoRequested As Long              '// # video buffers, If 0, autocalc
    fCaptureAudio As Long                   '// Capture audio?
    wNumAudioRequested As Long              '// # audio buffers, If 0, autocalc
    vKeyAbort As Long                       '// Virtual key causing abort
    fAbortLeftMouse As Long                 '// Abort on left mouse?
    fAbortRightMouse As Long                '// Abort on right mouse?
    fLimitEnabled As Long                   '// Use wTimeLimit?
    wTimeLimit As Long                      '// Seconds to capture
    fMCIControl As Long                     '// Use MCI video source?
    fStepMCIDevice As Long                  '// Step MCI device?
    dwMCIStartTime As Long                  '// Time to start in MS
    dwMCIStopTime As Long                   '// Time to stop in MS
    fStepCaptureAt2x As Long                '// Perform spatial averaging 2x
    wStepCaptureAverageFrames As Long       '// Temporal average n Frames
    dwAudioBufferSize As Long               '// Size of audio bufs (0 = default)
    fDisableWriteCache As Long              '// Attempt to disable write cache
    AVStreamMaster As Long                  '// Which stream controls length?
End Type


Public Sub Enregistrement()
Dim FileName As String
Dim heureStr As String
Dim dateStr As String
    
    frmMain.Shape1.BorderColor = vbRed
    
With CapParms
'   voir le message de confirmation
    .fMakeUserHitOKToCapture = False ' - converts VB Boolean to C BOOL
'   pour gestion si trop d image rejeter
    .wPercentDropForError = 10
'   fUsingDOSMemory est obselette
    .fUsingDOSMemory = False
'   The number of video buffers should be enough to get through
'   disk seeks and thermal recalibrations
    .wNumVideoRequested = 32
'   abandon sur click gauche
    .fAbortLeftMouse = -(True)
'   abandon sur click droit
    .fAbortRightMouse = -(True) '- converts VB boolean to C BOOL
'   If wChunkGranularity is zero, the granularity will be set to the
'   disk sector size.
    .wChunkGranularity = 0
'   default
    .dwAudioBufferSize = 0
'   le caching
    .fDisableWriteCache = -(True)
'   utilisation du MCI
    .fMCIControl = False
    .fStepCaptureAt2x = False
'   multi-threading
    .fYield = True
'   audio buffers
    .wNumAudioRequested = 4 '10 est la limit max

'   parametre charger a partir du registre
    .AVStreamMaster = AVSTREAMMASTER_AUDIO
'   fixe la taille max de AVI en frames
    .dwIndexSize = 32000

'   les parametre de la video fps,son,timelimit
    .dwRequestMicroSecPerFrame = 66667
    .fCaptureAudio = True
    .fLimitEnabled = True
    .wTimeLimit = 10
End With
    
    
    heureStr = Format(Now, "hh-mm-ss")
    dateStr = Format(Date, "yyyy-mm-dd")
    FileName = Module_base.Get_dossier_avi & "BV_" & dateStr & "_" & heureStr & "_1.avi"
    'Change le nom par default (c:\capture)
    SendMessageToRecord hwnd, WM_CAP_FILE_SET_CAPTURE_FILE, 0, ByVal FileName
    'Envoie les param de la video
    SendMessageToRecord hwnd, WM_CAP_SET_SEQUENCE_SETUP, Len(CapParms), CapParms
    'Commence la capture
    SendMessageToRecord hwnd, WM_CAP_SEQUENCE, Len(CapParms), CapParms
    
End Sub



 Sources de la même categorie

Source avec Zip Source .NET (Dotnet) .NET DEPENDENCY VIEWER : ARBRE DES DÉPENDANCES D'UN ASSEMBLY... par ShareVB
Source avec Zip Source .NET (Dotnet) UTILITAIRE SKYDRIVE par MasterShadows
Source avec Zip ROTATION RAPIDE D'IMAGE par trex70
Source avec Zip Source avec une capture ENUMERATION DES PORTS TCP ET IDENTIFCATION DU PROCESS (PID) ... par Renfield
Source avec Zip Source avec une capture MOUSE SPEED AND WEIGHT : RETOUR DE FORCE VIRTUEL ! par ScSami

Commentaires et avis

Commentaire de fabrice007 le 11/02/2005 10:00:59

/o/ ma première source, attention tou n'est pas de moi mais j'ai rien trouver pour la gestion du fichier video sur VBfrance alors je complete par un ex :)

Commentaire de jack le 11/02/2005 18:41:48 administrateur CS

Salut
Tu aurais pu te fouler d'une petite appli de démo ...

'CapParms' est défini comment ? (on s'en doute mais)
Idem, qu'est ce c'est que :
'Module_base.Get_dossier_avi'
'Shape1'
le hwnd de quoi ?
Et les valeurs de constantes ... c'est trouvable, mais bon

Ton code est inexploitable.

Commentaire de Keneyda le 12/02/2005 10:53:07

Peux tu mettre une sources pour que l'on comprenne mieux? STP

Merci d'avance

Keneyda

Commentaire de Keneyda le 12/02/2005 10:53:21

Peux tu mettre une sources pour que l'on comprenne mieux? STP

Merci d'avance

Keneyda

Commentaire de aaazzzeeerrr le 16/06/2005 11:29:26

je cherche un code qui enregistre un avi automatique et pour une durée de temps donnée par l"utilisateur.
s'il vous plait si vous avez une idée ou un code me l'envoyez sur cette adresse
haddadayadi@yahoo.fr
merci merci merci

Commentaire de midnightsoul le 10/05/2007 09:33:04

excelente

 Ajouter un commentaire




Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Février 2012
LMMJVSD
  12345
6789101112
13141516171819
20212223242526
272829    

Consulter la suite du CalendriCode

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 3,838 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales