Comment récupérer les images d'une Webcam ?

Vous débutez et vous avez besoin d'aide ? N'hésitez pas à poser vos questions
leoneo
Messages : 35
Inscription : sam. 24/janv./2004 19:49

Message par leoneo »

Bien sure que je l'ai : dans C:\WINDOWS\SYSTEM

Si tu l'as pas , tu la trouves facilement sur le net !
Avatar de l’utilisateur
Chris
Messages : 3731
Inscription : sam. 24/janv./2004 14:54
Contact :

Message par Chris »

Je viens de tester le code. Ca a l'air de fonctionner, mais j'ai pas de caméra non plus. :lol:

Par contre, j'ai quand même un périphérique de capture, ma carte TV, mais aucune caméra branchée dessus.
Si je retrouve les cables, j'essaierai de brancher un caméscope pour voir si ca fonctionne.
leoneo
Messages : 35
Inscription : sam. 24/janv./2004 19:49

Message par leoneo »

Je pense que chez moi la fonction Texte$ = PeekS(*ZoneMemoire [, Longueur]) ne fonctionne pas car ce n'est pas le premier code où elle ne marche pas !!
Backup
Messages : 14526
Inscription : lun. 26/avr./2004 0:40

Message par Backup »

Par contre, j'ai quand même un périphérique de capture, ma carte TV,
Arrrrg je viens de me rappeler que dans ma tour y a ma hauppauge wintv
que j'ai desinstale au niveau des drivers mais elle est dedans !!
vu que j'utilise l'autre la nexus !!
je vais reinstaller tous ça .... :)
Oliv
Messages : 2117
Inscription : mer. 21/janv./2004 18:39

Message par Oliv »

J'ai pas relu mais si votre code accèpte les caméras sur port firewire je veux bien essayer
Avatar de l’utilisateur
Chris
Messages : 3731
Inscription : sam. 24/janv./2004 14:54
Contact :

Message par Chris »

J'ai essayé de capturer un bout de film sur ma carte TV, ben ca marche pas bien.

L'image est trouble, on dirait du noir et blanc avec des couleurs par ci par là, et en plus, qui bavent, et le son fonctionne pendant quelques secondes, puis plus rien.
leoneo
Messages : 35
Inscription : sam. 24/janv./2004 19:49

Message par leoneo »

Et pourquoi chez moi le code ne marche pas !

Error at line 608 : Specified address is null !


line 608 : name$ = PeekS (lpszName)


Merci
Avatar de l’utilisateur
Flype
Messages : 2431
Inscription : jeu. 29/janv./2004 0:26
Localisation : Nantes

Message par Flype »

et çà çà devrait marcher :

Code : Tout sélectionner

;=========================================================================

IncludeFile "avicap32.pb"

;=========================================================================

OpenWindow(0,30,180,320,240,#PB_Window_SizeGadget|#PB_Window_SystemMenu,"AVICap")

;=========================================================================

AVICap_GetDriverNumber()
AVICap_Create(WindowID(),0,0,320,240,0)
AVICap_DriverConnect(0)
AVICap_Overlay(#True)

;=========================================================================

DriverName$    = Space(80)
DriverVersion$ = Space(40)
AVICap_DriverGetName   (@DriverName$   ,80)
AVICap_DriverGetVersion(@DriverVersion$,40) 
Debug DriverName$
Debug DriverVersion$

;=========================================================================

If 0
  Debug AVICap_DlgVideoSource()
  Debug AVICap_DlgVideoFormat()
  Debug AVICap_DlgVideoDisplay()
  Debug AVICap_DlgVideoCompression()
EndIf

;=========================================================================

Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow

;=========================================================================

AVICap_DriverDisconnect()
AVICap_LibClose()
End
et voilà le très long fichier d'include que je me suis contocté il y a longtemps...

Code : Tout sélectionner

;=========================================================================
;
; Object :      AVICap wrapper for PureBasic 3.80
; Author :      Philippe Carpentier
; Date :        16-dec-2003
; Note :        This module requiert the avicap32.dll installed in Windows
; Description : Set of functions for Video capture
;
;=========================================================================


;=========================================================================
;- AVICAP PUREBASIC HEADER
;=========================================================================


Global hLib.l, hCap.l

#AVICAP_LIB_INDEX   = 0
#AVICAP_LIB_NAME    = "avicap32.dll"
#AVICAP_FUNC_CREATE = "capCreateCaptureWindowA"
#AVICAP_FUNC_DRIVER = "capGetDriverDescriptionA"


;=========================================================================
;- AVICAP CONSTANTES MESSAGES
;=========================================================================


Enumeration
  
  #WM_CAP_START                   = #WM_USER
  #WM_CAP_GET_CAPSTREAMPTR
  #WM_CAP_SET_CALLBACK_ERROR
  #WM_CAP_SET_CALLBACK_STATUS
  #WM_CAP_SET_CALLBACK_YIELD
  #WM_CAP_SET_CALLBACK_FRAME
  #WM_CAP_SET_CALLBACK_VIDEOSTREAM
  #WM_CAP_SET_CALLBACK_WAVESTREAM
  #WM_CAP_GET_USER_DATA
  #WM_CAP_SET_USER_DATA
  #WM_CAP_DRIVER_CONNECT
  #WM_CAP_DRIVER_DISCONNECT
  #WM_CAP_DRIVER_GET_NAME
  #WM_CAP_DRIVER_GET_VERSION
  #WM_CAP_DRIVER_GET_CAPS
  #WM_CAP_FILE_SET_CAPTURE_FILE   = #WM_CAP_START + 20
  #WM_CAP_FILE_GET_CAPTURE_FILE
  #WM_CAP_FILE_ALLOCATE
  #WM_CAP_FILE_SAVEAS
  #WM_CAP_FILE_SET_INFOCHUNK
  #WM_CAP_FILE_SAVEDIB
  #WM_CAP_EDIT_COPY               = #WM_CAP_START + 30
  #WM_CAP_SET_AUDIOFORMAT         = #WM_CAP_START + 35
  #WM_CAP_GET_AUDIOFORMAT
  #WM_CAP_DLG_VIDEOFORMAT         = #WM_CAP_START + 41
  #WM_CAP_DLG_VIDEOSOURCE
  #WM_CAP_DLG_VIDEODISPLAY
  #WM_CAP_GET_VIDEOFORMAT
  #WM_CAP_SET_VIDEOFORMAT
  #WM_CAP_DLG_VIDEOCOMPRESSION
  #WM_CAP_SET_PREVIEW             = #WM_CAP_START + 50
  #WM_CAP_SET_OVERLAY
  #WM_CAP_SET_PREVIEWRATE
  #WM_CAP_SET_SCALE
  #WM_CAP_GET_STATUS
  #WM_CAP_SET_SCROLL
  #WM_CAP_GRAB_FRAME              = #WM_CAP_START + 60
  #WM_CAP_GRAB_FRAME_NOSTOP
  #WM_CAP_SEQUENCE
  #WM_CAP_SEQUENCE_NOFILE
  #WM_CAP_SET_SEQUENCE_SETUP
  #WM_CAP_GET_SEQUENCE_SETUP
  #WM_CAP_SET_MCI_DEVICE
  #WM_CAP_GET_MCI_DEVICE
  #WM_CAP_STOP
  #WM_CAP_ABORT
  #WM_CAP_SINGLE_FRAME_OPEN       = #WM_CAP_START + 70
  #WM_CAP_SINGLE_FRAME_CLOSE
  #WM_CAP_SINGLE_FRAME
  #WM_CAP_PAL_OPEN                = #WM_CAP_START + 80
  #WM_CAP_PAL_SAVE
  #WM_CAP_PAL_PASTE
  #WM_CAP_PAL_AUTOCREATE
  #WM_CAP_PAL_MANUALCREATE
  #WM_CAP_SET_CALLBACK_CAPCONTROL
  #WM_CAP_END                     = #WM_CAP_SET_CALLBACK_CAPCONTROL
  
EndEnumeration


;=========================================================================
;
;- STRUCT CAPDRIVERCAPS
;
; The CAPDRIVERCAPS Structure defines the capabilities of the
; capture driver. An application should use the WM_CAP_DRIVER_GET_CAPS
; message Or capDriverGetCaps macro to place a copy of the driver
; capabilities in a CAPDRIVERCAPS Structure whenever the application
; connects a capture window To a capture driver.
;
;=========================================================================


Structure CAPDRIVERCAPS
  
  wDeviceIndex.l              ; UINT    Index of the capture driver. An index value can range from 0 to 9.
  fHasOverlay.b               ; BOOL    Video-overlay flag. The value of this member is TRUE if the device supports video overlay.
  fHasDlgVideoSource.b        ; BOOL    Video source dialog flag. The value of this member is TRUE if the device supports a dialog box for selecting and controlling the video source.
  fHasDlgVideoFormat.b        ; BOOL    Video format dialog flag. The value of this member is TRUE if the device supports a dialog box for selecting the video format.
  fHasDlgVideoDisplay.b       ; BOOL    Video display dialog flag. The value of this member is TRUE if the device supports a dialog box for controlling the redisplay of video from the capture frame buffer.
  fCaptureInitialized.b       ; BOOL    Capture initialization flag. The value of this member is TRUE if a capture device has been successfully connected.
  fDriverSuppliesPalettes.b   ; BOOL    Driver palette flag. The value of this member is TRUE if the driver can create palettes.
  hVideoIn.l                  ; HANDLE  Not used in Win32 applications.
  hVideoOut.l                 ; HANDLE  Not used in Win32 applications.
  hVideoExtIn.l               ; HANDLE  Not used in Win32 applications.
  hVideoExtOut.l              ; HANDLE  Not used in Win32 applications.
  
EndStructure


;=========================================================================
;
;- STRUCT CAPSTATUS
;
; The CAPSTATUS structure defines the current state of the capture window.
;
;=========================================================================


Structure HPALETTE
  
  dummy.l ; no info about it :(
  
EndStructure

Structure CAPSTATUS
  
  uiImageWidth.l                ; UINT     Image width, in pixels.
  uiImageHeight.l               ; UINT     Image height, in pixels.
  fLiveWindow.b                 ; BOOL     Live window flag. The value of this member is TRUE if the window is displaying video using the preview method.
  fOverlayWindow.b              ; BOOL     Overlay window flag. The value of this member is TRUE if the window is displaying video using hardware overlay.
  fScale.b                      ; BOOL     Input scaling flag. The value of this member is TRUE if the window is scaling the input video to the client area
                                ;          when displaying video using preview. This parameter has no effect when displaying video using overlay.
  ptScroll.POINT                ; POINT    The x- and y-offset of the pixel displayed in the upper left corner of the client area of the window.
  fUsingDefaultPalette.b        ; BOOL     Default palette flag. The value of this member is TRUE if the capture driver is using its default palette.
  fAudioHardware.b              ; BOOL     Audio hardware flag. The value of this member is TRUE if the system has waveform-audio hardware installed.
  fCapFileExists.b              ; BOOL     Capture file flag. The value of this member is TRUE if a valid capture file has been generated.
  dwCurrentVideoFrame.l         ; DWORD    Number of frames processed during the current (or most recent) streaming capture. This count includes dropped frames.
  dwCurrentVideoFramesDropped.l ; DWORD    Number of frames dropped during the current (or most recent) streaming capture. Dropped frames occur when the capture rate exceeds the rate
                                ;          at which frames can be saved To file. In this case, the capture driver has no buffers available For storing Data. Dropping frames does not affect
                                ;          synchronization because the previous frame is displayed in place of the dropped frame.
  dwCurrentWaveSamples.l        ; DWORD    Number of waveform-audio samples processed during the current (or most recent) streaming capture.
  dwCurrentTimeElapsedMS.l      ; DWORD    Time, in milliseconds, since the start of the current (or most recent) streaming capture.
  hPalCurrent.HPALETTE          ; HPALETTE Handle of current palette.
  fCapturingNow.b               ; BOOL     Capturing flag. The value of this member is TRUE when capturing is in progress.
  dwReturn.l                    ; DWORD    Error return values. Use this member if your application does not support an error callback function.
  wNumVideoAllocated.l          ; UINT     Number of video buffers allocated. This value might be less than the number specified in the wNumVideoRequested member of the CAPTUREPARMS structure.
  wNumAudioAllocated.l          ; UINT     Number of audio buffers allocated. This value might be less than the number specified in the wNumAudioRequested member of the CAPTUREPARMS structure.
  
EndStructure


;=========================================================================
;
;- STRUCT CAPTUREPARMS
; 
; The CAPTUREPARMS Structure contains parameters that control
; the streaming video capture process. This Structure is used
; to get And set parameters that affect the capture rate,
; the number of buffers To use While capturing,
; And how capture is terminated.
;
;=========================================================================


Structure CAPTUREPARMS
  
  dwRequestMicroSecPerFrame.l ; DWORD Requested frame rate, in microseconds. The default value is 66667, which corresponds to 15 frames per second.
  fMakeUserHitOKToCapture.b   ; BOOL  User-initiated capture flag. If this member is TRUE, AVICap displays a dialog box prompting the user to initiate capture. The default value is FALSE.
  wPercentDropForError.l      ; UINT  Maximum allowable percentage of dropped frames during capture. Values range from 0 to 100. The default value is 10.
  fYield.b                    ; BOOL  Yield flag. If this member is TRUE, the capture window spawns a separate background thread to perform step and streaming capture. The default value is FALSE.
                              ;       Applications that set this flag must handle potential reentry issues because the controls in the application are not disabled While capture is in progress.
  dwIndexSize.l               ; DWORD Maximum number of index entries in an AVI file. Values range from 1800 to 324,000. If set to 0, a default value of 34,952 (32K frames plus a proportional number of audio buffers) is used.
                              ;       Each video frame Or buffer of waveform-audio Data uses one index entry. The value of this entry establishes a limit For the number of frames Or audio buffers that can be captured.
  wChunkGranularity.l         ; UINT  Logical block size, in bytes, of an AVI file. The value 0 indicates the current sector size is used as the granularity.
  fUsingDOSMemory.b           ; BOOL  Not used in Win32 applications.
  wNumVideoRequested.l        ; UINT  Maximum number of video buffers to allocate. The memory area to place the buffers is specified with fUsingDOSMemory. The actual number of buffers allocated might be lower if memory is unavailable.
  fCaptureAudio.b             ; BOOL  Capture audio flag. If this member is TRUE, audio is captured during streaming capture. This is the default value if audio hardware is installed.
  wNumAudioRequested.l        ; UINT  Maximum number of audio buffers to allocate. The maximum number of buffers is 10.
  vKeyAbort.l                 ; UINT  Virtual keycode used to terminate streaming capture. The default value is VK_ESCAPE. You must call the RegisterHotKey function before specifying a keystroke that can abort a capture session.
                              ;       You can combine keycodes that include CTRL And SHIFT keystrokes by using the logical Or operator with the keycodes For CTRL (0x8000) And SHIFT (0x4000).

  fAbortLeftMouse.b           ; BOOL  Abort flag for left mouse button. If this member is TRUE, streaming capture stops if the left mouse button is pressed. The default value is TRUE.
  fAbortRightMouse.b          ; BOOL  Abort flag for right mouse button. If this member is TRUE, streaming capture stops if the right mouse button is pressed. The default value is TRUE.
  fLimitEnabled.b             ; BOOL  Time limit enabled flag. If this member is TRUE, streaming capture stops after the number of seconds in wTimeLimit has elapsed. The default value is FALSE.
  wTimeLimit.l                ; UINT  Time limit for capture, in seconds. This parameter is used only if fLimitEnabled is TRUE.
  fMCIControl.b               ; BOOL  MCI device capture flag. If this member is TRUE, AVICap controls an MCI-compatible video source during streaming capture. MCI-compatible video sources include VCRs and laserdiscs.
  fStepMCIDevice.b            ; BOOL  MCI device step capture flag. If this member is TRUE, step capture using an MCI device as a video source is enabled. If it is FALSE, real-time capture using an MCI device is enabled. (If fMCIControl is FALSE, this member is ignored.)
  dwMCIStartTime.l            ; DWORD Starting position, in milliseconds, of the MCI device for the capture sequence. (If fMCIControl is FALSE, this member is ignored.)
  dwMCIStopTime.l             ; DWORD Stopping position, in milliseconds, of the MCI device for the capture sequence. When this position in the content is reached, capture ends and the MCI device stops. (If fMCIControl is FALSE, this member is ignored.)
  fStepCaptureAt2x.b          ; BOOL  Double-resolution step capture flag. If this member is TRUE, the capture hardware captures at twice the specified resolution. (The resolution for the height and width is doubled.) 
                              ;       Enable this option If the hardware does not support hardware-based decimation And you are capturing in the RGB format.
  wStepCaptureAverageFrames.l ; UINT  Number of times a frame is sampled when creating a frame based on the average sample. A typical value for the number of averages is 5.
  dwAudioBufferSize.l         ; DWORD Audio buffer size. If the default value of zero is used, the size of each buffer will be the maximum of 0.5 seconds of audio or 10K bytes.
  fDisableWriteCache.b        ; BOOL  Not used in Win32 applications.
  AVStreamMaster.l            ; UINT  Indicates whether the audio stream controls the clock when writing an AVI file. If this member is set to AVSTREAMMASTER_AUDIO,
                              ;       the audio stream is considered the master stream And the video stream duration is forced To match the audio duration. If this member is set To AVSTREAMMASTER_NONE, the durations of audio And video streams can differ.
EndStructure


;=========================================================================
; 
;- STRUCT CAPINFOCHUNK
; 
; The CAPINFOCHUNK structure contains parameters that can be used
; to define an information chunk within an AVI capture file.
; The WM_CAP_FILE_SET_INFOCHUNK message or capSetInfoChunk macro is used
; to send a CAPINFOCHUNK structure to a capture window.
; 
;=========================================================================


Structure FOURCC
  
  dummy.l ; no info about it :(
  
EndStructure

Structure CAPINFOCHUNK
  
  fccInfoID.FOURCC          ; FOURCC  Four-character code that identifies the representation of the chunk data.
                            ;         If this value is NULL And lpData is NULL, all accumulated information chunks are deleted.
  lpData.l                  ; LPVOID  Address of the data. If this value is NULL, all fccInfoID information chunks are deleted.
  cbData.l                  ; LONG    Size, in bytes, of the data pointed to by lpData.
                            ;         If lpData specifies a null-terminated string, use the string length incremented by one to save the NULL with the string.
EndStructure


;=========================================================================
;- AVICAP LIBRARY MANAGEMENT
;=========================================================================

Procedure.l AVICap_LibOpen()
  If hLib = #NULL
    hLib = OpenLibrary( #AVICAP_LIB_INDEX, #AVICAP_LIB_NAME )
  EndIf
  ProcedureReturn hLib
EndProcedure

Procedure.l AVICap_LibClose()
  If hLib <> #NULL
    CloseLibrary( #AVICAP_LIB_INDEX )
  EndIf
EndProcedure

Procedure.l AVICap_Create( ParentWindow.l, x.l, y.l, width.l, height.l, id.l )
  If AVICap_LibOpen() = #NULL
    ProcedureReturn #FALSE
  EndIf
  If IsFunction( #AVICAP_LIB_INDEX, #AVICAP_FUNC_CREATE ) = #FALSE
    ProcedureReturn #FALSE
  EndIf
  hCap = CallFunction( #AVICAP_LIB_INDEX, #AVICAP_FUNC_CREATE, "CaptureWindow", #WS_CHILD|#WS_VISIBLE, x, y, width, height, ParentWindow, id )
  ProcedureReturn hCap
EndProcedure

Procedure.l AVICap_GetDriverDescription( index.w, name.l, nsize.l, version.l, vsize.l )
  If AVICap_LibOpen() = #NULL
    ProcedureReturn #FALSE
  EndIf
  If IsFunction( #AVICAP_LIB_INDEX, #AVICAP_FUNC_DRIVER ) = #FALSE
    ProcedureReturn #FALSE
  EndIf
  ProcedureReturn CallFunction( #AVICAP_LIB_INDEX, #AVICAP_FUNC_DRIVER, index, name, nsize, version, vsize )
EndProcedure

Procedure AVICap_GetDriverNumber()
  For i=0 To 9
    If AVICap_GetDriverDescription( i, #NULL, #NULL, #NULL, #NULL ) = #FALSE
      ProcedureReturn i
    EndIf
  Next
EndProcedure


;=========================================================================
;- AVICAP DRIVER MANAGEMENT
;=========================================================================


Procedure.b AVICap_DriverConnect( index.l )
  ProcedureReturn SendMessage_( hCap, #WM_CAP_DRIVER_CONNECT, index, #NULL )
EndProcedure

Procedure.b AVICap_DriverDisconnect()
  ProcedureReturn SendMessage_( hCap, #WM_CAP_DRIVER_DISCONNECT, #NULL, #NULL )
EndProcedure

Procedure.b AVICap_DriverGetCaps( CapDriverCapsPtr.l, CapDriverCapsSize.l )
  ProcedureReturn SendMessage_( hCap, #WM_CAP_DRIVER_GET_CAPS, CapDriverCapsSize, CapDriverCapsPtr )
EndProcedure

Procedure.b AVICap_DriverGetName( name.l, size.l )
  ProcedureReturn SendMessage_( hCap, #WM_CAP_DRIVER_GET_NAME, size, name )
EndProcedure

Procedure.b AVICap_DriverGetVersion( version.l, size.l )
  ProcedureReturn SendMessage_( hCap, #WM_CAP_DRIVER_GET_VERSION, size, version )
EndProcedure


;=========================================================================
;- AVICAP DIALOG WINDOWS MANAGEMENT
;=========================================================================


Procedure.b AVICap_DlgVideoSource()
  ProcedureReturn SendMessage_( hCap, #WM_CAP_DLG_VIDEOSOURCE, #NULL, #NULL )
EndProcedure

Procedure.b AVICap_DlgVideoFormat()
  ProcedureReturn SendMessage_( hCap, #WM_CAP_DLG_VIDEOFORMAT, #NULL, #NULL )
EndProcedure

Procedure.b AVICap_DlgVideoDisplay()
  ProcedureReturn SendMessage_( hCap, #WM_CAP_DLG_VIDEODISPLAY, #NULL, #NULL )
EndProcedure

Procedure.b AVICap_DlgVideoCompression()
  ProcedureReturn SendMessage_( hCap, #WM_CAP_DLG_VIDEOCOMPRESSION, #NULL, #NULL )
EndProcedure


;=========================================================================
;- AVICAP VARIOUS FUNCTIONS
;=========================================================================


Procedure.b AVICap_GetStatus( CapStatusPtr.l, CapStatusSize.l )
  ProcedureReturn SendMessage_( hCap, #WM_CAP_GET_STATUS, CapStatusSize, CapStatusPtr )
EndProcedure

Procedure.b AVICap_Preview( bool.b )
  ProcedureReturn SendMessage_( hCap, #WM_CAP_SET_PREVIEW, bool, #NULL )
EndProcedure

Procedure.b AVICap_PreviewRate( milliSecs.w )
  ProcedureReturn SendMessage_( hCap, #WM_CAP_SET_PREVIEWRATE, milliSecs, #NULL )
EndProcedure

Procedure.b AVICap_PreviewScale( bool.b )
  ProcedureReturn SendMessage_( hCap, #WM_CAP_SET_SCALE, bool, #NULL )
EndProcedure

Procedure.b AVICap_Overlay( bool.b )
  ProcedureReturn SendMessage_( hCap, #WM_CAP_SET_OVERLAY, bool, #NULL )
EndProcedure

Procedure.b AVICap_SetScrollPos( PointPtr.l )
  ProcedureReturn SendMessage_( hCap, #WM_CAP_SET_SCROLL, #NULL, PointPtr )
EndProcedure


;=========================================================================
;- AVICAP CAPTURE MANAGEMENT
;=========================================================================


Procedure.b AVICap_CaptureAbort()
  ProcedureReturn SendMessage_( hCap, #WM_CAP_ABORT, #NULL, #NULL )
EndProcedure

Procedure.b AVICap_CaptureGetSetUp( CaptureParmsPtr.l, CaptureParmsSize.l )
  ProcedureReturn SendMessage_( hCap, #WM_CAP_GET_SEQUENCE_SETUP, CaptureParmsSize, CaptureParmsPtr )
EndProcedure

Procedure.b AVICap_CaptureSetSetUp( CaptureParmsPtr.l, CaptureParmsSize.l )
  ProcedureReturn SendMessage_( hCap, #WM_CAP_SET_SEQUENCE_SETUP, CaptureParmsSize, CaptureParmsPtr )
EndProcedure

Procedure.b AVICap_CaptureSequence()
  ProcedureReturn SendMessage_( hCap, #WM_CAP_SEQUENCE, #NULL, #NULL )
EndProcedure

Procedure.b AVICap_CaptureSequenceNoFile()
  ProcedureReturn SendMessage_( hCap, #WM_CAP_SEQUENCE_NOFILE, #NULL, #NULL )
EndProcedure

Procedure.b AVICap_CaptureSingleFrame()
  ProcedureReturn SendMessage_( hCap, #WM_CAP_SINGLE_FRAME, #NULL, #NULL )
EndProcedure

Procedure.b AVICap_CaptureSingleFrameClose()
  ProcedureReturn SendMessage_( hCap, #WM_CAP_SINGLE_FRAME_CLOSE, #NULL, #NULL )
EndProcedure

Procedure.b AVICap_CaptureSingleFrameOpen()
  ProcedureReturn SendMessage_( hCap, #WM_CAP_SINGLE_FRAME_OPEN, #NULL, #NULL )
EndProcedure

Procedure.b AVICap_CaptureStop()
  ProcedureReturn SendMessage_( hCap, #WM_CAP_STOP, #NULL, #NULL )
EndProcedure


;=========================================================================
;- AVICAP CLIPBOARD MANAGEMENT
;=========================================================================


Procedure.b AVICap_EditCopy()
  ProcedureReturn SendMessage_( hCap, #WM_CAP_EDIT_COPY, #NULL, #NULL )
EndProcedure


;=========================================================================
;- AVICAP GRAB MANAGEMENT
;=========================================================================


Procedure.b AVICap_GrabFrame()
  ProcedureReturn SendMessage_( hCap, #WM_CAP_GRAB_FRAME, #NULL, #NULL )
EndProcedure

Procedure.b AVICap_GrabFrameNoStop()
  ProcedureReturn SendMessage_( hCap, #WM_CAP_GRAB_FRAME_NOSTOP, #NULL, #NULL )
EndProcedure


;=========================================================================
;- AVICAP AUDIO FORMAT MANAGEMENT
;=========================================================================


Procedure.b AVICap_GetAudioFormat( WaveFormatExPtr.l, WaveFormatExSize.l )
  ProcedureReturn SendMessage_( hCap, #WM_CAP_GET_AUDIOFORMAT, WaveFormatExSize, WaveFormatExPtr )
EndProcedure

Procedure.b AVICap_GetAudioFormatSize()
  ProcedureReturn AVICap_GetAudioFormat( #NULL, #NULL )
EndProcedure

Procedure.b AVICap_SetAudioFormat( WaveFormatExPtr.l, WaveFormatExSize.l )
  ProcedureReturn SendMessage_( hCap, #WM_CAP_SET_AUDIOFORMAT, WaveFormatExSize, WaveFormatExPtr )
EndProcedure


;=========================================================================
;- AVICAP VIDEO FORMAT MANAGEMENT
;=========================================================================


Procedure.b AVICap_GetVideoFormat( BitmapInfoPtr.l, BitmapInfoSize.l )
  ProcedureReturn SendMessage_( hCap, #WM_CAP_GET_VIDEOFORMAT, BitmapInfoSize, BitmapInfoPtr )
EndProcedure

Procedure.b AVICap_GetVideoFormatSize()
  ProcedureReturn AVICap_GetVideoFormat( #NULL, #NULL )
EndProcedure

Procedure.b AVICap_SetVideoFormat( BitmapInfoPtr.l, BitmapInfoSize.l )
  ProcedureReturn SendMessage_( hCap, #WM_CAP_SET_VIDEOFORMAT, BitmapInfoSize, BitmapInfoPtr )
EndProcedure


;=========================================================================
;- AVICAP USERDATA MANAGEMENT
;=========================================================================


Procedure.l AVICap_GetUserData()
  ProcedureReturn SendMessage_( hCap, #WM_CAP_GET_USER_DATA, #NULL, #NULL )
EndProcedure

Procedure.b AVICap_SetUserData( user.l )
  ProcedureReturn SendMessage_( hCap, #WM_CAP_SET_USER_DATA, #NULL, user )
EndProcedure


;=========================================================================
;- AVICAP MCI MANAGEMENT
;=========================================================================


Procedure.b AVICap_GetMCIDeviceName( name.s, size.l )
  ProcedureReturn SendMessage_( hCap, #WM_CAP_GET_MCI_DEVICE, size, name )
EndProcedure

Procedure.b AVICap_SetMCIDeviceName( name.s )
  ProcedureReturn SendMessage_( hCap, #WM_CAP_SET_MCI_DEVICE, size, name )
EndProcedure


;=========================================================================
;- AVICAP FILE MANAGEMENT
;=========================================================================


Procedure.b AVICap_FileAlloc( size.l )
  ProcedureReturn SendMessage_( hCap, #WM_CAP_FILE_ALLOCATE, #NULL, size )
EndProcedure

Procedure.b AVICap_FileSaveAs( name.s )
  ProcedureReturn SendMessage_( hCap, #WM_CAP_FILE_SAVEAS, #NULL, name )
EndProcedure

Procedure.b AVICap_FileSaveDIB( name.s )
  ProcedureReturn SendMessage_( hCap, #WM_CAP_FILE_SAVEDIB, #NULL, name )
EndProcedure

Procedure.b AVICap_FileGetCaptureFile( name.s, size.l )
  ProcedureReturn SendMessage_( hCap, #WM_CAP_FILE_SET_CAPTURE_FILE, size, name )
EndProcedure

Procedure.b AVICap_FileSetCaptureFile( name.s )
  ProcedureReturn SendMessage_( hCap, #WM_CAP_FILE_SET_CAPTURE_FILE, #NULL, name )
EndProcedure

Procedure.b AVICap_FileSetInfoChunck( CapInfoChunkPtr.l )
  ProcedureReturn SendMessage_( hCap, #WM_CAP_FILE_ALLOCATE, #NULL, CapInfoChunkPtr )
EndProcedure


;=========================================================================
;- AVICAP PALETTE MANAGEMENT
;=========================================================================


Procedure.b AVICap_PaletteAuto( iFrames.l, iColors.l )
  ProcedureReturn SendMessage_( hCap, #WM_CAP_PAL_AUTOCREATE, iFrames, iColors )
EndProcedure

Procedure.b AVICap_PaletteManual( fGrab.l, iColors.l )
  ProcedureReturn SendMessage_( hCap, #WM_CAP_PAL_MANUALCREATE, fGrab, iColors )
EndProcedure

Procedure.b AVICap_PaletteOpen( name.s )
  ProcedureReturn SendMessage_( hCap, #WM_CAP_PAL_OPEN, #NULL, name )
EndProcedure

Procedure.b AVICap_PalettePaste()
  ProcedureReturn SendMessage_( hCap, #WM_CAP_PAL_PASTE, #NULL, #NULL )
EndProcedure

Procedure.b AVICap_PaletteSave( name.s )
  ProcedureReturn SendMessage_( hCap, #WM_CAP_PAL_SAVE, #NULL, name )
EndProcedure


;=========================================================================
;- AVICAP CALLBACK MANAGEMENT
;=========================================================================


Procedure.b AVICap_SetCallBackOnCapControl( procAddress.l )
  ProcedureReturn SendMessage_( hCap, #WM_CAP_SET_CALLBACK_CAPCONTROL, #NULL, procAddress )
EndProcedure

Procedure.b AVICap_SetCallBackOnError( procAddress.l )
  ProcedureReturn SendMessage_( hCap, #WM_CAP_SET_CALLBACK_ERROR, #NULL, procAddress )
EndProcedure

Procedure.b AVICap_SetCallBackOnFrame( procAddress.l )
  ProcedureReturn SendMessage_( hCap, #WM_CAP_SET_CALLBACK_FRAME, #NULL, procAddress )
EndProcedure

Procedure.b AVICap_SetCallBackOnStatus( procAddress.l )
  ProcedureReturn SendMessage_( hCap, #WM_CAP_SET_CALLBACK_STATUS, #NULL, procAddress )
EndProcedure

Procedure.b AVICap_SetCallBackOnVideoStream( procAddress.l )
  ProcedureReturn SendMessage_( hCap, #WM_CAP_SET_CALLBACK_VIDEOSTREAM, #NULL, procAddress )
EndProcedure

Procedure.b AVICap_SetCallBackOnWaveStream( procAddress.l )
  ProcedureReturn SendMessage_( hCap, #WM_CAP_SET_CALLBACK_WAVESTREAM, #NULL, procAddress )
EndProcedure

Procedure.b AVICap_SetCallBackOnYield( procAddress.l )
  ProcedureReturn SendMessage_( hCap, #WM_CAP_SET_CALLBACK_YIELD, #NULL, procAddress )
EndProcedure


;=========================================================================
;- AVICAP CALLBACK EXAMPLES
;=========================================================================


Procedure.b AVICap_CallbackOnCapControl( hWindow.l, wParam.l, lParam.l )
  Debug "CallBack.OnCapControl" : ProcedureReturn #TRUE
EndProcedure

Procedure.b AVICap_CallbackOnError( hWindow.l, wParam.l, lParam.l )
  Debug "CallBack.OnError" : ProcedureReturn #TRUE
EndProcedure

Procedure.b AVICap_CallbackOnFrame( hWindow.l, wParam.l, lParam.l )
  Debug "CallBack.OnFrame" : ProcedureReturn #TRUE
EndProcedure

Procedure.b AVICap_CallbackOnStatus( hWindow.l, wParam.l, lParam.l )
  Debug "CallBack.OnStatus" : ProcedureReturn #TRUE
EndProcedure

Procedure.b AVICap_CallbackOnVideoStream( hWindow.l, wParam.l, lParam.l )
  Debug "CallBack.OnVideoStream" : ProcedureReturn #TRUE
EndProcedure

Procedure.b AVICap_CallbackOnWaveStream( hWindow.l, wParam.l, lParam.l )
  Debug "CallBack.OnWaveStream" : ProcedureReturn #TRUE
EndProcedure

Procedure.b AVICap_CallbackOnYield( hWindow.l, wParam.l, lParam.l )
  Debug "CallBack.OnYield" : ProcedureReturn #TRUE
EndProcedure

Procedure.b AVICap_CallbackInitAll()
  AVICap_SetCallBackOnCapControl ( @AVICap_CallBackOnCapControl()  )
  AVICap_SetCallBackOnError      ( @AVICap_CallBackOnError()       )
  AVICap_SetCallBackOnFrame      ( @AVICap_CallBackOnFrame()       )
  AVICap_SetCallBackOnStatus     ( @AVICap_CallBackOnStatus()      )
  AVICap_SetCallBackOnVideoStream( @AVICap_CallBackOnVideoStream() )
  AVICap_SetCallBackOnWaveStream ( @AVICap_CallBackOnWaveStream()  )
  AVICap_SetCallBackOnYield      ( @AVICap_CallBackOnYield()       )
EndProcedure


;=========================================================================

Image
leoneo
Messages : 35
Inscription : sam. 24/janv./2004 19:49

Message par leoneo »

Effectivement ca marche !

Trés bien , ca prend qu'une image je regarderai plus tard pour un flux plus important !

Mercie
Backup
Messages : 14526
Inscription : lun. 26/avr./2004 0:40

Message par Backup »

il est Vraiment trop fort ce Flype !! :D


manque plus que la doc qui va avec !!! :)
comment ça j'en demande beaucoup ??

t'aurai comme moi le QI d'une poule tu demandrai pareil !!

ya des tas de procedures que ça pourrais etre une lib !!
et que franchement j'y comprend rien , mais ça n'est pas etonnant !
:D
Avatar de l’utilisateur
Flype
Messages : 2431
Inscription : jeu. 29/janv./2004 0:26
Localisation : Nantes

Message par Flype »

:oops: arrête c juste que j'ai déjà bosser dessus il y a qq temps mais merci quand meme :D
j'ai pas de web cam mais connaissant windows je vois pas comment on peut faire autrement que comme çà, alors je me disais bien que çà pouvait marcher même sur une webcam

chez moi ca marche nickel avec ma carte d'aquisition video (ati rage pro)
et sur ma carte tuner tv
Image
Backup
Messages : 14526
Inscription : lun. 26/avr./2004 0:40

Message par Backup »

cela ne retire rien a ton merite !! :D

tu compte faire une doc ?? pour expliquer les procedures ?
:)

sinon c'est pas grave ! mais j'aurai bien aime comprendre !! :D
Avatar de l’utilisateur
Flype
Messages : 2431
Inscription : jeu. 29/janv./2004 0:26
Localisation : Nantes

Message par Flype »

une doc... pfff... ouhlalalaa... rRRrrrrRrr... ho he heu pffffffffff :?

bon allez peut etre :wink: mais faudra patienter et pis en général (c comme çà que je suis) je préfère balancer des bouts de codes parlant plutot que de la vraie belle doc... ma doc c'est msdn
Image
Backup
Messages : 14526
Inscription : lun. 26/avr./2004 0:40

Message par Backup »

ok je comprend !!
:D

je demandais pas une doc avec reliure mais juste par exemple au hasard

"AVICap_Create( ParentWindow.l, x.l, y.l, width.l, height.l, id.l )"
cette procedure fait ceci et cela
elle attend comme argument

ParentWindow.l, = id fenetre enfin je suppose
x.l, = coin sup gauche du moniteur (le vrai qui est sur la table en face de toi he ! patate !!
y.l, = coin sup gauche du monitor qui est chez la voisine
width.l, = largeur de la fenetre , celle de ta piece va chercher un Metre !!
height.l, =hauteur d ela fenetre, ramene en plus un escabeau
id.l = je sais pas mais c'est pas grave

tu voi ce genre la , en plus vrai !! :D

mai je comprend que ta d'autre chatte a fouetter !! :lol:
Avatar de l’utilisateur
cederavic
Messages : 1338
Inscription : lun. 09/févr./2004 23:38
Localisation : Bordeaux

Message par cederavic »

ça date ce post mais comme quelque personne cherchent a choper l'image de leur webcam... j'ai regarder le premier code avec le bleme de Peeks et il m'a pas fallu longtemps pour les corriger :
line 605 et 607
remplacer

Code : Tout sélectionner

capGetDriverDescriptionA (0, lpszName, 100, lpszVer, 100)  ;// Retrieves driver info 

  name$ = PeekS (lpszName) 
par

Code : Tout sélectionner

capGetDriverDescriptionA (0, *lpszName, 100, lpszVer, 100)  ;// Retrieves driver info 

  name$ = PeekS (*lpszName) 
ps : j'ai pas encor tester le code de flype
Répondre