129
Capture Card SDK SDK Document

Capture Card SDKftp2.avermedia.com/SDK/Linux_HDCapSDK_EN.pdf · AVerMedia Capture Card Software Development Kit 1.2.2 Programming Language Support The API set supports programming

  • Upload
    others

  • View
    32

  • Download
    0

Embed Size (px)

Citation preview

Capture Card SDK

SDK Document

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

Disclaimer All the screen shots in this documentation are only example images. The images may vary depending on the product and software version. Information presented in this documentation has been carefully checked for reliability; however, no responsibility is assumed for inaccuracies. The information contained in this documentation is subject to change without notice.

Copyright ©2012 by AVerMedia Technologies, Inc. All rights reserved. No part of this document may be reproduced or transmitted in any form, or by any means without the prior written permission of AVerMedia Technologies Inc. AVerMedia Technologies Inc. reserves the right to modify its models, including their characteristics, specifications, accessories and any other information stated herein without notice. The official printout of any information shall prevail should there be any discrepancy between the information contained herein and the information contained in that printout. "AVerMedia" is a trademark (or registered trademark) of AVerMedia Technologies, Inc. Other trademarks used herein for description purpose only belong to each of their companies.

Taiwan Headquarter Office Address 7F.,No. 137, Jian 1st Rd., Zhonghe Dist., New Taipei City 23585, Taiwan (R.O.C.) Website www.avermedia.com/avertv/tw Tel +886-2-2226-3630

Version 1.0

1

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

Table of Contents

1.  SDK Introduction .............................................................................................................................................................................................................. 11 

1.1  Brief Introduction ........................................................................................................................................................................................................................... 11 

1.2  Instructions ........................................................................................................................................................................................................................................ 13 

1.2.1  API Brief Introduction ....................................................................................................................................................................................... 13 

1.2.2  Programming Language Support ................................................................................................................................................................. 14 

1.2.3  Sample Code ....................................................................................................................................................................................................... 14 

1.2.4  Header Files And Link Library ......................................................................................................................................................................... 14 

1.2.5  Platform & Thread Safety ................................................................................................................................................................................ 14 

1.2.6  Development Enviromental Detection ........................................................................................................................................................ 14 

1.2.7 Gstreamer plugin Installation ......................................................................................................................................................................... 15 

2

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.  API Function Instructions ............................................................................................................................................................................................... 16 

2.1  AVerGetDeviceNum ...................................................................................................................................................................................................................... 16 

2.2  AVerGetDeviceName .................................................................................................................................................................................................................... 17 

2.3  AVerCreateCaptureObject .......................................................................................................................................................................................................... 18 

2.4  AVerDeleteCaptureObject .......................................................................................................................................................................................................... 20 

2.5  AVerSetVideoSource ..................................................................................................................................................................................................................... 21 

2.6  AVerGetVideoSource .................................................................................................................................................................................................................... 23 

2.7  AVerSetVideoFormat .................................................................................................................................................................................................................... 24 

2.8  AVerGetVideoFormat ................................................................................................................................................................................................................... 26 

2.9  AVerSetVideoResolution ............................................................................................................................................................................................................ 27 

2.10 AVerGetVideoResolution ............................................................................................................................................................................................................ 30 

3

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.11 AVerRepaintVideo .......................................................................................................................................................................................................................... 31 

2.12 AVerSetVideoRenderer ................................................................................................................................................................................................................ 32 

2.13 AVerGetVideoRenderer ............................................................................................................................................................................................................... 33 

2.14 AVerSetMaintainAspectRatioEnabled .................................................................................................................................................................................. 34 

2.15 AVerGetMaintainAspectRatioEnabled .................................................................................................................................................................................. 35 

2.16 AVerGetAspectRatio ..................................................................................................................................................................................................................... 36 

2.17 AVerSetVideoDownscaleMode ................................................................................................................................................................................................ 37 

2.18 AVerGetVideoDownscaleMode ............................................................................................................................................................................................... 39 

2.19 AVerSetAudioSamplingRate ..................................................................................................................................................................................................... 40 

2.20 AVerGetAudioSamplingRate ..................................................................................................................................................................................................... 41 

2.21 AVerSetVideoProcAmp................................................................................................................................................................................................................ 42 

4

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.22 AVerGetVideoProcAmp ............................................................................................................................................................................................................... 43 

2.23 AVerSetDeinterlaceMode ........................................................................................................................................................................................................... 44 

2.24 AVerGetDeinterlaceMode .......................................................................................................................................................................................................... 45 

2.25 AVerStartStreaming ...................................................................................................................................................................................................................... 46 

2.26 AVerStopStreaming ...................................................................................................................................................................................................................... 47 

2.27 AVerCaptureVideoSequenceStart .......................................................................................................................................................................................... 49 

2.28 AVerCaptureVideoSequenceStop ........................................................................................................................................................................................... 53 

2.29 AVerCaptureAudioSampleStart ............................................................................................................................................................................................... 54 

2.30 AVerCaptureAudioSampleStartEx .......................................................................................................................................................................................... 56 

2.31 AVerCaptureAudioSampleStop ............................................................................................................................................................................................... 59 

2.32 AVerCaptureSingleImageToBuffer ......................................................................................................................................................................................... 59 

5

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.33 AVerSetOverlayProperty ............................................................................................................................................................................................................. 61 

2.34 AVerGetOverlayProperty ............................................................................................................................................................................................................ 64 

2.35 AVerOverlayText ............................................................................................................................................................................................................................. 65 

2.36 AVerOverlayTime ............................................................................................................................................................................................................................ 67 

2.37 AVerOverlayImage ......................................................................................................................................................................................................................... 69 

2.38 AVerSetNoiseReductionEnabled ............................................................................................................................................................................................. 71 

2.39 AVerGetNoiseReductionEnabled ............................................................................................................................................................................................ 72 

2.40 AVerSetVideoOutputFrameRate ............................................................................................................................................................................................. 73 

2.41 AVerGetVideoOutputFrameRate ............................................................................................................................................................................................. 74 

2.42 AVerSetVideoPreviewEnabled .................................................................................................................................................................................................. 75 

2.43 AVerGetVideoPreviewEnabled ................................................................................................................................................................................................. 76 

6

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.44 AVerSetAudioPreviewEnabled ................................................................................................................................................................................................. 77 

2.45 AVerGetAudioPreviewEnabled................................................................................................................................................................................................. 79 

2.46 AVerEnumVideoCompressor .................................................................................................................................................................................................... 79 

2.47 AVerSetVideoCompressorInfo ................................................................................................................................................................................................. 81 

2.48 AVerGetVideoCompressorInfo ................................................................................................................................................................................................ 82 

2.49 AVerEnumAudioCompressor .................................................................................................................................................................................................... 83 

2.50 AVerSetAudioCompressorInfo ................................................................................................................................................................................................. 85 

2.51 AVerGetAudioCompressorInfo ................................................................................................................................................................................................ 86 

2.52 AVerSetVideoStreamMixingProperty ................................................................................................................................................................................... 87 

2.53 AVerGetVideoStreamMixingProperty .................................................................................................................................................................................. 89 

2.54 AVerMixVideoStream ................................................................................................................................................................................................................... 90 

7

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.55 AVerSetWMVVideoEncoderInfo .............................................................................................................................................................................................. 92 

2.56 AVerGetWMVVideoEncoderInfo ............................................................................................................................................................................................. 95 

2.57 AVerSetWMVAudioEncoderInfo ............................................................................................................................................................................................. 96 

2.58 AVerGetWMVAudioEncoderInfo ............................................................................................................................................................................................ 99 

2.59 AVerSetVideoClippingRect ........................................................................................................................................................................................................ 99 

2.60 AVerGetVideoClippingRect .................................................................................................................................................................................................... 100 

2.61 AVerSetVideoEnhanceMode .................................................................................................................................................................................................. 101 

2.62 AVerGetVideoEnhanceMode ................................................................................................................................................................................................. 103 

2.63 AVerSetVideoMirrorMode ...................................................................................................................................................................................................... 104 

2.64 AVerGetVideoMirrorMode ..................................................................................................................................................................................................... 106 

2.65 AVerSetMpeg2VideoEncoderInfo ....................................................................................................................................................................................... 107 

8

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.66 AVerGetMpeg2VideoEncoderInfo ....................................................................................................................................................................................... 111 

2.67 AVerSetMpeg2AudioEncoderInfo ....................................................................................................................................................................................... 112 

2.68 AVerGetMpeg2AudioEncoderInfo ...................................................................................................................................................................................... 114 

2.69 AVerSetMpeg4VideoEncoderInfo ....................................................................................................................................................................................... 115 

2.70 AVerGetMpeg4VideoEncoderInfo ....................................................................................................................................................................................... 118 

2.71 AVerSetMpeg4AudioEncoderInfo ....................................................................................................................................................................................... 119 

2.72 AVerGetMpeg4AudioEncoderInfo ...................................................................................................................................................................................... 121 

2.73 AVerSetVideoRotateMode ...................................................................................................................................................................................................... 122 

2.74 AVerGetVideoRotateMode ..................................................................................................................................................................................................... 124 

2.75 AVerSetVideoUpscaleBlackRect ........................................................................................................................................................................................... 125 

2.76 AVerGetVideoUpscaleBlackRect .......................................................................................................................................................................................... 127 

9

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

3.  Error Code ........................................................................................................................................................................................................................ 129 

10

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

1. SDK Introduction

1.1 Brief Introduction Video capture card SDK (Software Development Kit) provides a powerful set of API in SO(Shared Object) mode for users to make use of this card more conveniently and efficiently. Video capture card SDK is developed based on Gstreamer 0.10.35. Gstreamer multimedia framework is an open source library, which is similar to DirectShow in Windows. This API set implements the following functions:

Capture and preview recording in the video window Add user-defined text, image and timestamps onto recording Snapshot in BMP, JPG, PNG, TIFF, AVI , WMV, MPG, MP4 formats or send screenshots back to

user through callback function De-interlace Adjust video brightness, contrast, hue and saturation Shrink video resolution to improve performance Reduce noise Reduce video frame rate to improve performance Capture audio in WAV format or send audio data back to users through callback function Support using common codecs in Gstreamer when recording AVI files Mix other video displays onto the current video display Specify crop region for captured video image Enhance video quality Mirror video horizontally or vertically

11

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

Rotate video clockwise and counter-clockwise Upscale video by padding the margin with black strips Support choosing different video renderers Support multiple video capture cards

* Here, video capture card, if not specified specially, refers to C727 & C729 & C199X high-definition video capture card. * To keeping consistent with the Windows version of SDK, some data types are redefined to be supported by Linux. * For Linux system APIs without wchar_t support, WCHAR and LPWSTR are defined as char and char* for convenience.

12

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

1.2 Instructions

1.2.1 API Brief Introduction

Refer to the following steps to use these API functions:

Step Related API Function Select a card and create a corresponding video capture object

AVerGetDeviceNum() AVerCreateCaptureObject()

Set video parameters AVerSetVideoSource() AVerSetVideoFormat() AVerSetVideoResolution() AVerSetVideoDownscaleMode()

Start capturing AVerStartStreaming() Add text, image or timestamps AVerSetOverlayProperty()

AVerOverlayText() AVerOverlayImage() AVerOverlayTime()

Snapshot AVerCaptureVideoSequenceStart() AVerCaptureSingleImageToBuffer()

Other adjustments AVerSetDeinterlaceMode() AVerSetVideoProcAmp()

13

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

1.2.2 Programming Language Support The API set supports programming languages C and C++.

1.2.3 Sample Code Supply sample codes, demos and source codes in the language of C++ for your reference.

1.2.4 Header Files And Link Library AVerHDCapAPI.h, AVerHDCapAPI.so and libavmvideoproc.so must be included.

1.2.5 Platform & Thread Safety The SDK currently supports Linux desktop platform only (ubuntu 11.10 desktop amd64). API calling for different video capture cards can work well in multiple processes or threads. However, for single video capture card, it’s not safe to call the same API function from multiple threads at the same time. (not multi-thread safe)

1.2.6 Development Environment Detection The SDK supplies a command-line environment detection tool (environmentdetector). It can tell whether the user’s Ubuntu system supports this version of SDK or not. It will show PASS or FAIL in the rightmost of the command line for each item inspected. Specific Instruction: OS(Operating system): Showing FAIL means the current version of the SDK doesn’t support user’s OS. Please use

the required OS that the SDK supports. gtk2.0: Showing FAIL means the DemoAP for the current version of SDK may not work normally. The

14

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

DemoAP is developed based on gtk2.0 2.24.6. To have the DemoAP run properly, please switch to the required OS and try to run the DemoAP again. (This item doesn’t affect the use of the SDK, just affect the DemoAP only)

Gstreamer: Showing FAIL means the current version of Gstreamer is too low and needs update. Use the following commands to update the version of Gstreamer:

sudo apt-get update sudo apt-get install libgstreamer0.10-0 Preview gstreamer plugins: If all these items show PASS, SDK can provide basic preview functionalities. Encoder gstreamer plugins: If all these items show PASS, SDK can provide encoding functionalities. If some plugin items show FAIL, please refer to 1.2.7.

1.2.7 Gstreamer Plugin Installation Gstreamer plugin can be installed by running installplugins.sh which is supplied by the SDK. This is an online installation, so please keep the internet connected. After the installation, please run the environment detection tool to make sure if the installation is successful or not.

15

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2. API Function Instructions

2.1 LONG WINAPI AVerGetDeviceNum (DWORD*pdwDeviceNum) Get amount of video capture card in current system.

Parameter

Name Description pdwDeviceNum Return the amount of video capture card

Return value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter

Introduction

The SDK supports multiple video capture cards (either in the same or different processes), which means users have to know the amount of cards in current system and how to configure or operate the desired one. Therefore, SDK provides corresponding APIs. To use one of those cards, you have to create the card handle first as all related APIs will use this handle for further operations. For more details about each API, please read the following document.

16

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.2 LONG WINAPI AVerGetDeviceName (DWORD dwDeviceIndex, LPWSTR

szDeviceName)

Get the device name (friendly name) of one of video capture cards in current system.

Parameter

Name Description dwDeviceIndex Specify the video capture card index szDeviceName Back to the device name for the corresponding index. The memory

size is allocated by the user and must be more than sizeof(char) * 256.

Return value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter

Introduction

If the system has multiple video capture cards, their indexes will be defined from 0 to (N-1) and their friendly names will contain the corresponding index. They can be assigned from their index. Besides, users can differentiate the type of the card according to the name returned.

17

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.3 LONG WINAPI AVerCreateCaptureObject (DWORD dwDeviceIndex, HWND

hWnd, HANDLE *phCaptureObject)

Create a capture object and Return the handle of the capture object.

Parameter

Name Description dwDeviceIndex Specify the index for the video capture card hWnd Window handle provided by user. The window associated with the

capture object is used for displaying video pictures. If hWnd is set to NULL, video will not be displayed.

phCaptureObject Return the handle of the capture object

Return value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_DEVICE_IN_USE Fail to assign the selected video capture card. Resource conflicts.

(Due to the limitation of Ubuntu, this return value will not be returned. Check if the card is in use by StartStreaming only.)

CAP_EC_UNKNOWN_ERROR Unknown error

18

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

Introduction

Before using the video capture card, user have to create (or initialize) a capture object handle with this API. The capture object will be related with the assigned video capture card; thus, all APIs that configure or control this video capture card have to be based on this object handle to work properly in the system with multiple video capture card installed.

19

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.4 LONG WINAPI AVerDeleteCaptureObject (HANDLE hCaptureObject) Delete the capture object and release the devices occupied by the selected video capture card.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter

Introduction

Once the capture object has been deleted, the corresponding type of capture object could be used again by other threads or processes.

20

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.5 LONG WINAPI AVerSetVideoSource (HANDLE hCaptureObject, DWORD

dwVideoSource)

Set input terminal of video signal. Video signal could be inputted to video capture card from terminals such as COMPOSITE, SVIDEO, COMPONENT (YCbCr) or HDMI.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object dwVideoSource Specify the input video terminal. Here are the values available for

configuration: VIDEOSOURCE_COMPOSITE,VIDEOSOURCE_SVIDEO, VIDEOSOURCE_COMPONENT,VIDEOSOURCE_HDMI

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_ERROR_STATE The video capture card is working

21

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

22

Introduction

For C727 & C729: Supported input ports are COMPOSITE, SVIDEO, COMPONENT(YCbCr) and HDMI. The dwVideoSource can not be set as VIDEOSOURCE_VGA, otherwise, it will return CAP_EC_INVALID_PARAM. For C199X: Supported input ports include HDMI and VGA. For C199X, the dwVideoSource can only be set as VIDEOSOURCE_HDMI or VIDEOSOURCE_VGA, otherwise, it will returen CAP_EC_INVALID_PARAM. The different type of capture card supports different input ports. The differences are show in the below table:

Capture Card Type COMPOSITE SVIDEO COMPONENT HDMI VGA

C727 √ √ √ √ C729 √ √ √ √

C199X √ √

When the input is VGA, SDK will enumerate and use the first third-party audio capture device. If there isn’t any third-party audio device, no audio will be outputted.

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.6 LONG WINAPI AVerGetVideoSource (HANDLE hCaptureObject, DWORD

*pdwVideoSource)

Get the current input video terminal.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object pdwVideoSource Return the current input video terminal

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter

23

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.7 LONG WINAPI AVerSetVideoFormat (HANDLE hCaptureObject, DWORD

dwVideoFormat)

Set video standard of input video signal. (NTSC or PAL).

Parameter

Name Description hCaptureObject Specify a handle for the video capture object dwVideoFormat Specify the video standard. Here are the values available for

configuration: VIDEOFORMAT_NTSC,VIDEOFORMAT_PAL

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_ERROR_STATE The video capture card is working

Introduction

If frame rate of input video is 29.97 or 59.94, user should set NTSC as the video standard. If frame rate of input video is 25 or 50, user should set PAL as the video standard.

24

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

Important Notes: 1. For C729 capture card, it supports input video frame rate of 24 or 35, in this case, users can set video format either

as NTSC or PAL. 2. For C199X, when the input signal is 1280*1024p@60 or 1400*900p@60, the actual output of the capture card will

be 1280*1024p@50 or 1400*900p@50, so users need to set the format to PAL; when the input signal is 1680*1050p@60, the actual output of the capture card will be 1680*1050p@35, in this case, setting the format to NTSC or PAL are both OK.; when the input signal is 1920*1080p@50/60, the actual output of the capture card will be 1920*1080p@25/30.

25

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.8 LONG WINAPI AVerGetVideoFormat (HANDLE hCaptureObject, DWORD

*pdwVideoFormat)

Get video standard of the current input video signal.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object pdwVideoFormat Return the video standard of current input video signal

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter

26

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.9 LONG WINAPI AVerSetVideoResolution (HANDLE hCaptureObject, DWORD

dwVideoResolution)

Set video resolution of input video signal.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object dwVideoResolution Specify a video resolution of input video signal.

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_ERROR_STATE The video capture card is working

Introduction

The supported video resolutions of the input video signal are listed in the below table. Different type of video capture card supports different input video resolution. C729 capture card supports more resolutions than C727. A “√”in the table denotes the video capture card supports this resolution.

27

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

28

dwVideoResolution Resolution Frame Rate

C727 C729 C199X Remarks PAL NTSC

VIDEORESOLUTION_640X480 640*480 - 29.97 √ √ VIDEORESOLUTION_704X576 704*576 25 - √ √ VIDEORESOLUTION_720X480 720*480 - 29.97 √ √ VIDEORESOLUTION_720X480P 720*480 - 59.94 √ √ VIDEORESOLUTION_720X576 720*576 25 - √ √ VIDEORESOLUTION_720X576P 720*576 50 - √ √ VIDEORESOLUTION_1280X720P 1280*720 50 59.94 √ √ √ VIDEORESOLUTION_1920X1080 1920*1080 25 29.97 √ √ √ VIDEORESOLUTION_1024X768P 1024*768 - 59.94 √ √ For

C727&C729 ,supported only when input is from HDMI

VIDEORESOLUTION_1280X800P 1280*800 - 59.94 √ √ VIDEORESOLUTION_1280X1024P 1280*1024 50 - √ √ VIDEORESOLUTION_1440X900P 1440*900 50 - √ √ VIDEORESOLUTION_1600X1200P 1600*1200 - 29.97 √ VIDEORESOLUTION_1680X1050P 1680*1050 35 35 √ √ VIDEORESOLUTION_1920X1080P 1920*1080 25 29.97 √ √ VIDEORESOLUTION_1920X1080P_24FPS 1920*1080 24 24 √ VIDEORESOLUTION_640X480P 640*480 - 59.94 √ VIDEORESOLUTION_800X600P 800*600 - 59.94 √ VIDEORESOLUTION_1280x768P 1280*768 - 59.94 √ VIDEORESOLUTION_1360x768P 1360*768 - 59.94 √

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

The resolutions suffixed with a “P”, such as VIDEORESOLUTION _720X480P, indicate progressive video frame; otherwise, it’s interlaced. “De-interlace” can prevent the situation of displaying interlaced image. If the input video resolution is not supported by the video capture object, for example, if the input resolution is VIDEORESOLUTION_720X480P and the hCaptureObject created by the user is of DEVICETYPE_SD type, then this function will return CAP_EC_INVALID_PARAM. For C199X, when the input signal is 1280*1024p@60 or 1400*900p@60, the actual output of the capture card will be 1280*1024p@50 or 1400*900p@50; when the input signal is 1680*1050p@60, the actual output of the capture card will be 1680*1050p@35; when the input signal is 1920*1080p@50/60, the actual output of the capture card will be 1920*1080p@25/30.

29

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.10 LONG WINAPI AVerGetVideoResolution (HANDLE hCaptureObject, DWORD

*pdwVideoResolution)

Get video resolution of the current input video signal.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object pdwVideoResolution Return the video resolution of current input video signal

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter

30

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.11 LONG WINAPI AVerRepaintVideo(HANDLE hCaptureObject)

Repaint video image if the video window is repainted.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_UNKNOWN_ERROR Unknown error

Introduction

If AVerSetMaintainAspectRatioEnabled() is called, users must call this function to repaint video.

31

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.12 LONG WINAPI AVerSetVideoRenderer(HANDLE hCaptureObject, DWORD

dwVideoRenderer)

Choose the video renderer for image preview.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object dwVideoRenderer Specify the type of video renderer. Valid values are:

VIDEORENDERER_DEFAULT , VIDEORENDERER_XIMAGESINK(zoom display is not supported),VIDEORENDERER_XVIMAGESINK

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_ERROR_STATE The video capture card is working

Introduction

1.If dwVideoRenderer is set to VIDEORENDERER_DEFAULT, the default video renderer is

VIDEORENDERER_XVIMAGESINK in this version.

32

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.13 LONG WINAPI AVerGetVideoRenderer(HANDLE hCaptureObject, DWORD

*pdwVideoRenderer)

Get the type of the current video renderer.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object pdwVideoRenderer Return the type of current video renderer

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter

33

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.14 LONG WINAPI AVerSetMaintainAspectRatioEnabled(HANDLE hCaptureObject,

BOOL bEnabled)

Set whether to maintain aspect ratio for images in the preview window.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object bEnabled Specify whether to maintain aspect ratio. True is to maintain aspect

ratio

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_UNKNOWN_ERROR Unknown error

34

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.15 LONG WINAPI AVerGetMaintainAspectRatioEnabled(HANDLE hCaptureObject,

BOOL *pbEnabled) Get the current setting of whether maintaining aspect ratio is enabled or not.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object pbEnabled Return the current setting of whether maintaining aspect ratio is

enabled

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter

35

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.16 LONG WINAPI AVerGetAspectRatio(HANDLE hCaptureObject, DWORD*

pdwAspectRatioX, DWORD* pdwAspectRatioY)

Get the aspect ratio of the video image.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object pdwAspectRatioX Return the X dimension of image aspect ratio. pdwAspectRatioY Return the Y dimension of image aspect ratio.

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter

Introduction

For the original input video image, if it is standard-definition resolution, the returned aspect ratio is 4:3; if it is

high-definition resolution, the returned aspect ratio is 16:9.

For video image processed by clipping, rotation, etc., the returned aspect ratio is the one corrected by calculation.

36

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.17 LONG WINAPI AVerSetVideoDownscaleMode (HANDLE hCaptureObject,

DWORD dwMode, DWORD dwWidth, DWORD dwHeight)

Set current video downscale mode.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object dwMode Specify the video downscale mode. Read the introduction for more

details dwWidth Specify the downscaled video width. The value must be the multiple

of 16 and stay within [128,2000] dwHeight Specify the downscaled video height. The value must be the multiple

of 16 and stay within [128,2000]

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_ERROR_STATE The video capture card is working

37

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

Introduction

Downscaling means to shrink the width and height of input video by a certain ratio. For example, shrinking the video size from 640x480 to 320x240. (Both width and height are half of original video.) Here are the modes available for downscaling:

DSMODE_NONE: do not make downscale DSMODE_HALFHEIGHT: shrinks the picture height to the half of the origin, maintains the width DSMODE_HALFWIDTH: shrinks the picture width to the half of the origin, maintains the height DSMODE_HALFBOTH: shrinks both of the picture width and height to the half of the origin DSMODE_CUSTOM: shrinks the picture width and height to the user defined dwWidth and

dwHeight Excepting DSMODE_CUSTOM, all other modes ignore the dwWidth and dwHeight parameters. Important Notes: 1. In this version of SDK, there are four functions that may change the width and height of the output video. The

internal processing order of the four functions are: AVerSetVideoClippingRect, AverSetVideoRotateMode, AverSetVideoDownscaleMode and AVerSetVideoUpscaleBlackRect, i.e. the video will be clipped first, then rotated, downscaled and lastly padded with black strips.

2. If users have called AVerSetVideoClippingRect() to clip the video, for DSMODE_CUSTOM, they must set the width and height less than or equal to the width and height of the clipped video.

3. If users have called AVerSetVideoRotateMode() to rotate the video, for DSMODE_CUSTOM, they must set the width and height less than or equal to the width and height of the rotated video.

38

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.18 LONG WINAPI AVerGetVideoDownscaleMode (HANDLE hCaptureObject,

DWORD *pdwMode, DWORD *pdwWidth, DWORD *pdwHeight)

Return the current video downscale mode.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object pdwMode Return the video downscale mode pdwWidth Return the downscaled video width. Only works in

DSMODE_CUSTOM mode. pdwHeight Return the downscaled video height. Only works in

DSMODE_CUSTOM mode.

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter

39

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.19 LONG WINAPI AVerSetAudioSamplingRate (HANDLE hCaptureObject, DWORD

dwSamplingRate)

Set audio sampling rate of the current input audio signal.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object dwSamplingRate Specify the audio sampling rate of input audio signal. Valid values

are: 48000, 44100, 32000

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_ERROR_STATE The video capture card is working CAP_EC_NOT_SUPPORTED Audio capturing is not supported

Introduction

1. For C199X, if the input is VGA, audio capturing is not supported and calling this function will return CAP_EC_NOT_SUPPORTED

40

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.20 LONG WINAPI AVerGetAudioSamplingRate (HANDLE hCaptureObject, DWORD

*pdwSamplingRate)

Get audio sampling rate of the current input audio signal.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object pdwSamplingRate Return the audio sampling rate of current input audio signal

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_NOT_SUPPORTED Audio capturing is not supported

41

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.21 LONG WINAPI AVerSetVideoProcAmp (HANDLE hCaptureObject, DWORD

dwVideoProcAmpProperty, DWORD dwPropertyValue)

Set video color properties, including brightness, contrast, hue, and saturation.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object dwVideoProcAmpProperty Specify a property to set. Here are the values available for

configuration: VIDEOPROCAMPPROPERTY_BRIGHTNESS, VIDEOPROCAMPPROPERTY_CONTRAST, VIDEOPROCAMPPROPERTY_HUE, VIDEOPROCAMPPROPERTY_SATURATION

dwPropertyValue Specify a value of a certain property, which could be from 0 to 255

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_ERROR_STATE The video capture card is not working CAP_EC_NOT_SUPPORTED The property is not supported

42

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.22 LONG WINAPI AVerGetVideoProcAmp (HANDLE hCaptureObject, DWORD

dwVideoProcAmpProperty, DWORD *pdwPropertyValue)

Get video color properties including brightness, contrast, hue, and saturation.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object dwVideoProcAmpProperty Specify a property to get pdwPropertyValue Return the property value

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_ERROR_STATE The video capture card is not working CAP_EC_NOT_SUPPORTED The property is not supported

43

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.23 LONG WINAPI AVerSetDeinterlaceMode (HANDLE hCaptureObject, DWORD

dwMode)

Set the de-interlace mode for the input video.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object dwMode Specify a de-interlace mode. Here are the values available for

configuration: DEINTERLACE_NONE, DEINTERLACE_WEAVE, DEINTERLACE_BOB, DEINTERLACE_BLEND

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_ERROR_STATE The video capture card is not working

44

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.24 LONG WINAPI AVerGetDeinterlaceMode (HANDLE hCaptureObject, DWORD

*pdwMode)

Get the current de-interlace mode for the input video.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object pdwMode Return the value of the de-interlace mode

Return value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_ERROR_STATE The video capture card is not working

45

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.25 LONG WINAPI AVerStartStreaming (HANDLE hCaptureObject)

Initiate the video capture card. Start capturing and displaying videos.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object

Return value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_ERROR_STATE The video capture card is working

Introduction

The following methods must be called before capturing or you will get a CAP_EC_ERROR_STATE error: AVerSetVideoSource() AVerSetVideoFormat() AVerSetVideoResolution() If you want to reset the video configurations by the methods listed above, call AVerStopStreaming() first to stop the video capture card. After the new configuration is done, call AVerStartStreaming() to restart the video capture card.

46

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.26 LONG WINAPI AVerStopStreaming (HANDLE hCaptureObject)

Stop the video capture card. Stop capturing and displaying videos.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter

47

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.27 LONG WINAPI AVerCaptureVideoSequenceStart (HANDLE hCaptureObject,

VIDEO_CAPTURE_INFO CaptureInfo)

Start capturing and saving one or more pictures in BMP, JPG, PNG, TIFF, AVI, WMV, MPG or MP4 formats or send them out through predefined callback function.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object CaptureInfo Specify how to capture pictures. Read the following instruction for

details.

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_ERROR_STATE The video capture card is not working

48

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

Introduction

Here is the supported list of AVerCaptureVideoSequenceStart(): Capture pictures in frames or fields Capture pictures in a period of time or N consecutive pictures(N could be 1) Capture picture and save them as BMP, JPG , PNG or TIFF files Capture pictures and save them in AVI format Capture pictures and save them in WMV format Capture pictures and save them in MPG format Capture pictures and save them in MP4 format Capture pictures and send them to users through the pre-defined callback function Capture pictures and add text / user-defined image / time / date on them Important Notes: 1. Only one video capturing method is available at one time. This means the screenshots cannot be saved in BMP and AVI formats simultaneously. However, AVerCaptureVideoSequenceStart() and AVerCaptureSingleImageToBuffer() can run simultaneously.

49

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

The capturing methods described above are set in VIDEO_CAPTURE_INFO structure. Here are the details of each variable:

Member Variable Description dwCaptureType Specify capture the picture in frames or in fields. Here is the value

available for configuration: CT_SEQUENCE_FIELD,CT_SEQUENCE_FRAME

dwSaveType Specify a picture saving type. Here are the values available for configuration: ST_BMP:save as BMP file,ST_JPG:save as JPG file, ST_PNG:save as PNG file,ST_TIFF:save as TIFF file,ST_AVI:save as AVI file,ST_CALLBACK:send to user by callback function, ST_WMV : save as WMV file, ST_MPG : save as MPG file, ST_MP4 : save as MP4 file

bOverlayMix Specify whether the user-defined text, image, time, or mixed video stream information should be overlaid on the captured pictures. For the types of BMP/JPG/ PNG/TIFF/callback function,do overlay mix when bOverlayMix is TRUE, otherwise don’t do;for AVI /WMV/MPG/MP4 type,do overlay mix all the time no matter whether bOverlayMix is.

dwDurationMode Specify meanings of dwDuration. If dwDurationMode is DURATION_TIME, dwDuration is in milliseconds; if dwDurationMode is DURATION_COUNT, dwDuration means the count of picture to capture.

dwDuration Specify the capturing duration or count of picture to capture.

50

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

51

Member Variable Description If dwDuration is 0xFFFFFFFF, capture pictures until user stops the process. dwDurationMode and dwDuration are meaningful only for ST_BMP, ST_JPG , ST_PNG and ST_TIFF; for ST_AVI , ST_CALLBACK, ST_WMV, ST_MPG and ST_MP4, once the capture process starts, it will not stop until being cancelled.

lpFileName Specify the BMP, JPG, PNG, AVI, WMV, MPG or MP4 file name. Ignore the variable when dwSaveType is ST_CALLBACK. For BMP, JPG , PNG or TIFF file,the naming method for capturing multiple pictures is(+time & date+count):FileName+YYMMDDHHMMSS+XX.BMP/JPG/PNG/TIF

lpCallback Specify the pointer to the callback function. The definition & introduction of the function are in the following. lpCallback and lCallbackUserData are only used in ST_CALLBACK mode

lCallbackUserData Specifies the user-defined data, which will be sent back to the user by the callback function

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

Definition and parameter description for callback function: BOOL WINAPI VIDEOCAPTURECALLBACK(VIDEO_SAMPLE_INFO VideoInfo, BYTE *pbData, LONG lLength, __int64 tRefTime, LONGPTR lUserData);

Member Variable Description VideoInfo Specify the video data format returned by callback function. Here are

the details of each variable: dwWidth: picture width dwHeight: picture height dwStride: vertically adjacent two pixel distance in bytes

dwPixelFormat: picture pixel format,the value now is ’YUY2’ (4 bytes DWORD) only

pbData Pointer to the buffer containing the video data. The user must cope with the video data before the callback function returns since buffer allocated by capture object will be invalid after that.

lLength Specify the data length in bytes tRefTime Specify the captured time of video data. This time, in units of 100

nanoseconds, could be used as reference for synchronizing audio and video

lUserData User-defined data which would be sent back to user by callback function, the value is the same as lCallbackUserData described above.

52

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.28 LONG WINAPI AVerCaptureVideoSequenceStop (HANDLE hCaptureObject)

Stop snapshot.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_ERROR_STATE The video capture card is not working

Introduction

Stopping all capturing operations by AVerCaptureVideoSequenceStart(). AVerCaptureVideoSequenceStop() stops capturing pictures immediately even if the duration set by AVerCaptureVideoSequenceStart() is undue.

53

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.29 LONG WINAPI AVerCaptureAudioSampleStart (HANDLE hCaptureObject,

AUDIOCAPTURECALLBACK lpCallback, LONGPTR lCallbackUserData)

Start capturing audio samples and send them to the pre-defined callback function.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object lpCallback Specify the pointer to the callback function. The definition &

introduction of the function are in the following. lCallbackUserData Specify the user-defined data, which will be sent back to the user by

the callback function

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_ERROR_STATE The video capture card is not working CAP_EC_NOT_SUPPORTED Audio capturing is not supported

54

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

Introduction

Definition & introduction of the callback function: BOOL WINAPI AUDIOCAPTURECALLBACK(AUDIO_SAMPLE_INFO AudioInfo, BYTE *pbData, LONG lLenght, __int64 tRefTime, LONGPTR lUserData);

Member Variable Description AudioInfo Specify the audio data format returned by callback function. Here are

the details of each variable: dwChannels: count of the audio channel dwBitsPerSample: bits per audio sample dwSamplingRate: audio sampling rate

pbData Pointer to the buffer containing the audio data. The user must cope with the audio data before the callback function returns since buffer allocated by user will be invalid after that.

lLength Specify the data length in bytes tRefTime Specify the captured time of audio data. In units of 100 nanoseconds,

it can be used as reference for synchronizing audio and video. lUserData User-defined data which would be sent back to user by callback

function, the value is the same as lCallbackUserData described above.

55

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.30 LONG WINAPI AVerCaptureAudioSampleStartEx (HANDLE hCaptureObject,

AUDIO_CAPTURE_INFO CaptureInfo)

This function extents the functionality of AVerCaptureAudioSampleStart(), it not only supports sending captured audio data to a pre-defined callback function, but also supports saving captured audio data into a WAV file.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object CaptureInfo Specify the audio capturing information

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_ERROR_STATE The video capture card is not working CAP_EC_NOT_SUPPORTED Audio capturing is not supported

Introduction

AVerCaptureAudioSampleStartEx() function supports two methods of audio capturing: Capture audio and save them in WAV format Capture audio and send it to user through pre-defined callback function

56

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

Important Notes: 1. Only one audio capturing method can work at one time. This means the audio data cannot be saved in WAV formats and through callback function simultaneously. The capturing methods described above are set in AUDIO_CAPTURE_INFO structure. Here are the details of each variable:

Member Variable Description dwSaveType Specify an audio data saving type. Here are the values available for

configuration: ST_WAV:save as WAV file ST_CALLBACK:send to user by callback function

lpFileName Specify the WAV file name. Ignore the variable when dwSaveType is ST_CALLBACK.

lpCallback Specify the pointer to the callback function. See the description in AVerCaptureAudioSampleStart() function. lpCallback and lCallbackUserData are only used in ST_CALLBACK mode.

lCallbackUserData Specify the user-defined data. See the description in AVerCaptureAudioSampleStart() function.

dwReserved This parameter is reserved for future use, currently must be set to 0

57

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.31 LONG WINAPI AVerCaptureAudioSampleStop (HANDLE hCaptureObject)

Stop capturing the audio samples.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_ERROR_STATE The video capture card is not working CAP_EC_NOT_SUPPORTED Audio capturing is not supported

58

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.32 LONG WINAPI AVerCaptureSingleImageToBuffer (HANDLE hCaptureObject,

BYTE *lpBmpData, LONG *plBufferSize, BOOL bOverlayMix, DWORD

dwTimeout)

Capture one picture and save it in BMP format in user memory.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object lpBmpData Pointer to the buffer allocated by user plBufferSize Pointer to the variable where to the buffer size is stored bOverlayMix Specify whether the user-defined text, image or time information

should be overlaid on the captured pictures. dwTimeout Specify the duration in nanoseconds. If the picture cannot be

captured in the duration, stops capturing and returns.

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_NOT_ENOUGH_MEMORY Not enough memory CAP_EC_TIMEOUT Fail to capture pictures in the appointed duration

59

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

Introduction

Screenshots will be saved in the buffer allocated by user. The format is BMP, which contains BITMAPFILEHEADER, BITMAPINFOHEADER and RGB24 raw data. The buffer should be big enough to save the picture, or an error will occur. If the user has no idea how much space should be allocated, just call AVerCaptureSingleImageToBuffer() and set lpBmpData to NULL, the function will indicate required buffer size through variable pointed by plBufferSize, then call AVerCaptureSingleImageToBuffer() again with the right size.

60

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.33 LONG WINAPI AVerSetOverlayProperty (HANDLE hCaptureObject, DWORD

dwContentType, OVERLAY_INFO OverlayInfo) Set overlay properties including text, user-defined image and time information.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object dwContentType Specify the overlay type. Here are the values available for

configuration: OVERLAY_TEXT,OVERLAY_TIME,OVERLAY_IMAGE

OverlayInfo Specify the overlay property to set. Read the following instruction for details.

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_ERROR_STATE The video capture card is not working

61

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

Introduction

AVerSetOverlayProperty() is used to set overlay properties. Call the following functions to do the actual overlay operations: AVerOverlayText(), AVerOverlayTime(), AVerOverlayImage(). There are three kinds of content for overlaying: OVERLAY_TEXT, OVERLAY_TIME, and OVERLAY_IMAGE. They can be opened at the same time optionally. If they need to be opened at the same time, call AVerSetOverlayProperty() for three times to set the properties separately. There can be only one overlay of the same content type at the same time,For example, it is not allowed to overlay two lines of text at different positions of the same picture.

62

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

Set the properties of overlay content in OVERLAY_INFO structure. Here are the details of each variable:

Member Variable Description bEnableOverlay Specify whether to enable overlay. If the value is TRUE, overlay is open. dwFontSize Specify the font size for displaying the text or time, the variable is ignored

for image overlay. The value can be set to FONTSIZE_SMALL or FONTSIZE_BIG

dwFontColor Specify the font color for displaying the text or time,the variable is ignored for image overlay. The three bytes starting from the lowest dwFontColor represent R,G,B color (the highest byte is 0), each value of RGB is from 0 to 255

dwTransparency Set transparency of the overlay content. For text and time overlay, it means the transparency of the respective window on which to do the overlay; for image, it means the transparency of the user-defined image.

WindowPosition Set displaying position of the overlay content. OVERLAY_POSITION structure has three variables, dwXPos and dwYPos represent the X, Y position of the video picture on which to display overlay content,(0,0) represents the upper left corner; dwAlignment indicates the alignment method. ALIGNMENT_CENTER represents aligning center, which means the dwXPos is as the center to the left and right extension of the overlay content; ALIGNMENT_LEFT and ALIGNMENT_RIGHT represent aligning left and aligning right separately. The overlay content which is beyond the scope of the original video picture is not displayed.

63

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.34 LONG WINAPI AVerGetOverlayProperty (HANDLE hCaptureObject, DWORD

dwContentType, OVERLAY_INFO* pOverlayInfo)

Get a certain overlay property.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object dwContentType Specify the overlay type pOverlayInfo Return the variable of the overlay property

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_ERROR_STATE The video capture card is not working

64

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.35 LONG WINAPI AVerOverlayText (HANDLE hCaptureObject, LPWSTR lpText,

DWORD dwDuration)

Overlay the text specifying the text content and the duration for how long the text should be displayed on the video.

Parameter

Name Description hCaptureObject Specify the handle for the video capture object lpText Pointer to the buffer where text overlaid is stored. The text is shown

as a line on the video picture. User has to adjust the text length or the text beyond the scope of the video picture will not be displayed.

dwDuration Specify the duration in seconds for displaying text on the video. If dwDuration is 0xFFFFFFFF, it displays the text all the time unless new configuration is set or the user has closed text overlay.

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_ERROR_STATE The video capture card is not working

65

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

Introduction

Call AVerOverlayText() repeatedly to display different text at different time, only the text specified by the last call is displayed on the picture, all text and displaying duration set by the previous call is invalid. Call AVerOverlayText() with dwDuration setting to 0 to make the overlay text invisible; to disable overlaying text, call AVerSetOverlayProperty(), select the corresponding overlay type and set bEnableOverlay in OVERLAY_INFO to FALSE.

66

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.36 LONG WINAPI AVerOverlayTime (HANDLE hCaptureObject, DWORD dwFormat,

DWORD dwDuration)

Overlay the time specifying the time format and the duration for how long the time should be displayed on the video.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object dwFormat Specify the time format. Here are the values available for

configuration: FORMAT_TIMEONLY:display time only FORMAT_DATEANDTIME:display time and date

dwDuration Specify the duration in seconds for displaying time. If dwDuration is 0xFFFFFFFF, it will show the timestamp all the time unless new configuration is set or the user has closed time overlay.

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_ERROR_STATE The video capture card is not working

67

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

Introduction

Call AVerOverlayTime() with dwDuration setting to 0 to make the overlay time invisible; To disable overlaying time, call AVerSetOverlayProperty(), select the corresponding overlay type and set bEnableOverlay in OVERLAY_INFO to FALSE.

68

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.37 LONG WINAPI AVerOverlayImage (HANDLE hCaptureObject,

OVERLAY_IMAGE_INFO ImageInfo, DWORD dwDuration)

Overlay the user defined image,specifies the image info and the duration for how long the image should be displayed on the video.

Parameter

Name Description hCaptureObject Specify the handle for the video capture object ImageInfo Specify the image information, OVERLAY_IMAGE_INFO structure has

two member variables: lpFileName: specifies the image file path(including the name) dwImageType:This paparmeter is obsolete now Supported picture formats are: BMP, JPG, PNG, TIFF, and alpha blending is also supported if pictures have alpha channel info so that picture background can be removed

dwDuration Specify the duration in seconds for displaying images on the video. If dwDuration is 0xFFFFFFFF, it displays the image all the time unless new configuration is set or the user has closed image overlay.

69

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_ERROR_STATE The video capture card is not working CAP_EC_NOT_SUPPORTED Picture format is not supported

Introduction

Call AVerOverlayImage() to make the overlay image invisible by setting lpFileName to NULL and dwDuration to 0. To disable overlaying image, call AVerSetOverlayProperty(), select the corresponding overlay type and set bEnableOverlay in OVERLAY_INFO to FALSE.

70

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.38 LONG WINAPI AVerSetNoiseReductionEnabled(HANDLE hCaptureObject, BOOL

bEnabled) Apply noise reduction to the output video.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object bEnabled Specify whether to enable noise reduction. TRUE to enable

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_ERROR_STATE The video capture card is not working CAP_EC_UNKNOWN_ERROR Unknown error

Introduction

Noise reduction can reduce or eliminate noise pixels on videos to improve the picture quality. However, it is not proper to apply noise reduction on all situations.

71

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

72

2.39 LONG WINAPI AVerGetNoiseReductionEnabled(HANDLE hCaptureObject, BOOL

*pbEnabled) Get the current setting of noise reduction.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object pbEnabled Return the current noise reduction configuration

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_ERROR_STATE The video capture card is not working CAP_EC_UNKNOWN_ERROR Unknown error

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.40 LONG WINAPI AVerSetVideoOutputFrameRate(HANDLE hCaptureObject,

DWORD dwFrameRate) Set the frame rate of the output video.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object dwFrameRate Specify the frame rate of the output video

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_ERROR_STATE The video capture card is working

Introduction

This function is used when users are willing to sacrifice the frame rate to get higher bandwidth efficiency and performance. Users shall set the frame rate equal to or less than that of the input video signal (i.e. 5≦ dwFrameRate/100 ≦ frame rate of the input signal). If dwFrameRate is equal to 0, it means cancelling the setting of output frame rate. The dwFrameRate parameter shall equal to 100 times of desired frame rate. That says, if a user wants to set the frame rate as 10, dwFrameRate must be set as 1000.

73

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.41 LONG WINAPI AVerGetVideoOutputFrameRate(HANDLE hCaptureObject,

DWORD *pdwFrameRate) Get the current frame rate setting of the output video.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object pdwFrameRate Return the current frame rate of the output video

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter

74

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.42 LONG WINAPI AVerSetVideoPreviewEnabled(HANDLE hCaptureObject, BOOL

bEnabled) Display the captured video in a preview window.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object bEnabled Specify whether to display captured video in a preview window.

TRUE to display

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_ERROR_STATE The video capture card is working

Introduction

Normally, after calling AVerStartStreaming() function, captured video will be displayed in a standard video preview window. Still, users may call this function to set bEnabled to FALSE to disable the video being displayed. In this situation, the user can process and display the captured video in their own way.

75

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.43 LONG WINAPI AVerGetVideoPreviewEnabled(HANDLE hCaptureObject, BOOL

*pbEnabled) Get the current setting of whether the captured video is displayed in a standard video preview window.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object pbEnabled Return the current setting of whether the captured video is

displayed

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter

76

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.44 LONG WINAPI AVerSetAudioPreviewEnabled(HANDLE hCaptureObject, BOOL

bEnabled) Enable audio playback while capturing audio.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object bEnabled Specify whether to enable audio playback. TRUE to enable audio

playback.

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_ERROR_STATE The video capture card is working CAP_EC_NOT_SUPPORTED Audio capturing is not supported

Introduction

Normally, after calling AVerStartStreaming() function, captured audio will be played back during capturing. Still, users may call this function to set bEnabled to FALSE to disable audio being played back. In this situation, users can process and play the captured audio in their own way.

77

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.45 LONG WINAPI AVerGetAudioPreviewEnabled(HANDLE hCaptureObject, BOOL

*pbEnabled) Get the current setting of whether the captured audio is played back during capturing.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object pbEnabled Return the setting of whether the captured audio is played back

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_NOT_SUPPORTED Audio capturing is not supported

78

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.46 LONG WINAPI AVerEnumVideoCompressor(HANDLE hCaptureObject,

VIDEO_COMPRESSOR_INFO *pVideoCompressorInfo, DWORD *pdwNum) List the available Gstreamer video encoders installed in users’system and return the number and information of the video encoders.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object pVideoCompressorInfo Return the information of video encoders pdwNum Return the number of video encoders

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_UNKNOWN_ERROR Unknown error

Introduction

Users may call this function to list the available Gstreamer video encoders in their system to capture AVI files with these encoders. The information of available video encoders is stored in an array of VIDEO_COMPRESSOR_INFO structures. The size of the array is determined by the number of available encoders, and callers are responsible for allocating memory for this array. When calling this function for the first time, users may set pVideoCompressorInfo to

79

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

NULL, and the function will Return the number of available encoders in the DWORD pointed by pdwNum. Then users may allocate memory for pVideoCompressorInfo according to the *pdwNum value. Calling this function again to get the information of the available encoders. The related information of video encoders is stored in the VIDEO_COMPRESSOR_INFO structure. Here are the descriptions of each member:

Member Variable Description szName Specify the name of the video encoder. The maximum length of the name

is 128 wide characters. dwBitrate Specify the bitrate of the compressed video.

80

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.47 LONG WINAPI AVerSetVideoCompressorInfo(HANDLE hCaptureObject,

VIDEO_COMPRESSOR_INFO *pVideoCompressorInfo) Select one video encoder and configure the related information. The video encoder will be used in recording AVI files.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object pVideoCompressorInfo Specify the related information of selected video encoder. If

pVideoCompressorInfo is NULL, no video encoder will be used in recording AVI files.

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter

81

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.48 LONG WINAPI AVerGetVideoCompressorInfo(HANDLE hCaptureObject,

VIDEO_COMPRESSOR_INFO *pVideoCompressorInfo) Get the related information of the selected video encoder.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object pVideoCompressorInfo Return the related information of the selected video encoder.

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter

82

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.49 LONG WINAPI AVerEnumAudioCompressor(HANDLE hCaptureObject,

AUDIO_COMPRESSOR_INFO *pAudioCompressorInfo, DWORD *pdwNum) List available Gstreamer audio encoders installed in users’system, and return the number and related information of the audio encoders.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object pAudioCompressorInfo Return the related information of audio encoders pdwNum Return the number of audio encoders

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_UNKNOWN_ERROR Unknown error

Introduction

Users may call this function to list the available Gstreamer audio encoders in their system to capture AVI files with these encoders. The information of available audio compressors is stored in an array of AUDIO_COMPRESSOR_INFO structures. The size of the array is determined by the number of available encoders, and callers are responsible for allocating memory for this array. When calling this function for the first time, users may set pAudioCompressorInfo

83

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

to NULL, and the function will Return the number of available encoders in the DWORD pointed by pdwNum. Then users may allocate memory for pAudioCompressorInfo according to the *pdwNum value. Calling this function again can get the information of the available encoders. The information of audio encoders is stored in the AUDIO_COMPRESSOR_INFO structure. Here are the descriptions of each member:

Member Variable Description szName Specify the name of the audio encoder. The maximum length of the name

is 128 characters. dwBitrate Specify the bitrate of the compressed audio.

84

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

85

2.50 LONG WINAPI AVerSetAudioCompressorInfo(HANDLE hCaptureObject,

AUDIO_COMPRESSOR_INFO *pAudioCompressorInfo) Select one audio compressor and configure the related information. The audio encoder will be used in recording AVI files.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object pAudioCompressorInfo Specify the related information of selected audio encoder and the

information. If pAudioCompressorInfo is NULL, no audio encoder will be used in recording AVI files.

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.51 LONG WINAPI AVerGetAudioCompressorInfo(HANDLE hCaptureObject,

AUDIO_COMPRESSOR_INFO *pAudioCompressorInfo) Get the related information of the selected audio encoder.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object pAudioCompressorInfo Return the related information of the selected audio encoder

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter

 

86

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.52 LONG WINAPI AVerSetVideoStreamMixingProperty(HANDLE hCaptureObject,

DWORD dwStreamID, VIDEO_STREAM_INFO VideoStreamInfo) Set the property of the video stream which will be mixed to the current video stream.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object dwStreamID Specify the ID of the video stream VideoStreamInfo Specify the property of the video stream

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_ERROR_STATE The video capture card is not working CAP_EC_UNKNOWN_ERROR Unknown error

Introduction

AVerSetVideoStreamMixingProperty() is used to set the property of the video stream which will be mixed to the current video stream. The actual work of “mixing” every frame in two video streams is done in AVerMixVideoStream(). dwStreamID is the ID number of a video stream to be mixed. When there are multiple video streams to be mixed,

87

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

dwStreamID identifies one specific video stream. But, please be noted that this version of SDK supports only one video stream to be mixed. dwStreamID must be no less than 1. Video streams to be mixed may come from some other capture devices. The properties of the video stream to be mixed shall be set in VIDEO_STREAM_INFO structure. Here are the details of each member:

Member Variable Description bEnableMix Specify whether to enable mixing, TRUE to enable dwWidth Specify the width of the video to be mixed dwHeight Specify the height of the video to be mixed dwPixelFormat Specify the pixel format of the video to be mixed, currently only support

‘YUY2’format rcMixPosition Specify the display rectangle of the video to be mixed, the width and the

height of the rectangle must be multiple of 16 and lie within [80, 2000] dwTransparency Specify the transparency of the video to be mixed, valid values must lie

within [0,100], 0 means opacity dwReserved1 Reserved, must be set to 0 dwReserved2 Reserved, must be set to 0

88

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.53 LONG WINAPI AVerGetVideoStreamMixingProperty(HANDLE hCaptureObject,

DWORD dwStreamID, VIDEO_STREAM_INFO *pVideoStreamInfo) Get the property of the video stream being mixed.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object dwStreamID Specify the ID of the video stream pVideoStreamInfo Return the property of the video stream

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_ERROR_STATE The video capture card is not working CAP_EC_UNKNOWN_ERROR Unknown error

 

89

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.54 LONG WINAPI AVerMixVideoStream(HANDLE hCaptureObject, DWORD

dwStreamID, BYTE *pData, DWORD dwStride, LONG lLength, __int64 tRefTime,

DWORD dwOptions) Mix one video frame of the being-mixed video stream onto the video frame of the current video stream.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object dwStreamID Specify the ID of the video stream pData Pointer to the buffer containing the data of one video frame which

will be mixed to the video frame of the current video stream dwStride Specify the distance in bytes of two vertically adjacent pixels in the

video frame lLength Specify the length of the video frame in bytes tRefTime Specify the captured time of the video frame, in units of 100

nanoseconds. It can be used as reference time for synchronization dwOptions Reserved for future use, must be set to 0

90

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_ERROR_STATE The video capture card is not working CAP_EC_UNKNOWN_ERROR Unknown error

Introduction

This function mixes one video frame of the dwStreamID video stream onto the frame of the current video stream. Users need to call this function continuously so that every frame of the dwStreamID video stream will eventually be mixed onto the frames of the current video stream. The properties of the dwStreamID video stream must be set beforehand by calling AVerSetVideoStreamMixingProperty(). The video frame data of the dwStreamID video stream shall be supplied by users, who may acquire them from some other video capture devices.

91

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.55 LONG WINAPI AVerSetWMVVideoEncoderInfo(HANDLE hCaptureObject,

WMV_VIDEOENCODER_INFO VideoEncoderInfo) Set the properties of WMV video encoder.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object VideoEncoderInfo Set the properties of WMV video encoder. Read the remarks for

details

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter

 

92

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

Introduction

Set the properties of WMV video encoder in WMV_VIDEOENCODER_INFO structure. Here are the details of each member:

Member Variable Description dwVersion Specify the version number of the structure. Different version

number results in different definition of the structure. Currently, dwVersion must be set to 1.

dwBitrate Specify the bitrate of the WMV video in Kbps The reference table below lists some common bitrate settings for certain resolutions NO. Resolution Bitrate(Kbps) 1 640X480 1500 2 704X576 2000 3 720X480 2000 4 720X480P 4000 5 720X576 2000 6 720X576P 4000 7 1280X720P 9000 8 1920X1080 10000 9 1024X768P 8000 10 1280X800P 10000 11 1280X1024P 13000

93

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

94

NO. Resolution Bitrate(Kbps) 12 1440X900P 12500 13 1600X1200P 10000 14 1680X1050P 9000 15 1920X1080P 10000 16 1920X1080P_24FPS 10000 17 640X480P 3000 18 800X600P 5000 19 1280X768P 10000 20 1360X768P 10000 Important Notes: 1. For the same video resolution, lower bitrate may result in higher frame rate, i.e. users may trade bitrate for frame rate when the CPU power is not ideal. 2. If the input video is interlaced, it is better for users to call AVerSetDeinterlaceMode() first to deinterlace it, and then process to record WMV files. Otherwise, the video quality of the WMV file may be affected.

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.56 LONG WINAPI AVerGetWMVVideoEncoderInfo(HANDLE hCaptureObject,

WMV_VIDEOENCODER_INFO *pVideoEncoderInfo) Get the properties of WMV video encoder.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object pVideoEncoderInfo Return the properties of WMV video encoder

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter

 

95

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.57 LONG WINAPI AVerSetWMVAudioEncoderInfo(HANDLE hCaptureObject,

WMV_AUDIOENCODER_INFO AudioEncoderInfo) Set the properties of WMV audio encoder.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object AudioEncoderInfo Set the properties of WMV audio encoder. Read the remarks for

details

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter

 

96

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

Introduction

Set the properties of WMV audio encoder in WMV_AUDIOENCODER_INFO structure. Here are the details of each member:

Member Variable Description dwVersion Specify the version number of the structure. Different version

number results in different definition of the structure. Currently, dwVersion must be set to 1.

dwBitrate Specify the bitrate of the WMV audio, in uints of Kbps

97

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.58 LONG WINAPI AVerGetWMVAudioEncoderInfo(HANDLE hCaptureObject,

WMV_AUDIOENCODER_INFO *pAudioEncoderInfo) Get the properties of WMV audio encoder.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object pAudioEncoderInfo Return the properties of WMA audio encoder

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter

 

98

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.59 LONG WINAPI AVerSetVideoClippingRect(HANDLE hCaptureObject, RECT

rcClippingRect)

Set the rectangle region for clippling, video contents outside of the rectangle region will be clipped.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object rcClippingRect Specify the rectangle region for clippling. See remarks below

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_ERROR_STATE The video capture card is working

Introduction

Video clipping is used for retaining the video we want while clipping the part we don’t want, for example, we can use this function to remove the black strip on both sides of the video. For the rectangle region, it’s width and height must be multiple of 16 and less than or equal to the original width and height. If users want to cancel the clipping, they can this function again with the four members of the RECT all set to 0.

99

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.60 LONG WINAPI AVerGetVideoClippingRect(HANDLE hCaptureObject, RECT

*prcClippingRect)

Get the rectangle region of the current clippling setting.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object prcClippingRect Return the rectangle region of the current clippling setting

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter

Introduction

This function will return the rectangle of the original video resolution if AVerSetVideoClippingRect() is not called beforehand.

100

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.61 LONG WINAPI AVerSetVideoEnhanceMode(HANDLE hCaptureObject, DWORD

dwMode)

Set the video enhancement mode.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object dwMode Specify the video enhancement mode, valid values are:

VIDEOENHANCE_NONE, VIDEOENHANCE _NORMAL, VIDEOENHANCE _SPLIT, VIDEOENHANCE _COMPARE

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_ERROR_STATE The video capture card is not working CAP_EC_UNKNOWN_ERROR Unknown error

101

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

Introduction

Video enhancement is used for sharping the color of video image, making it look more vivid. But please note that not every scenario fits for video enhancement. There are four video enhancement modes: VIDEOENHANCE_NONE: no video enhancement will be applied VIDEOENHANCE_NORMAL: video enhancement is applied to the whole frame VIDEOENHANCE_SPLIT: video enhancement is applied to the right half of the frame, the left half remains

original VIDEOENHANCE_COMPARE: two frames displayed side by side, left side is the original one, right side is the

enhanced one VIDEOENHANCE_SPLIT and VIDEOENHANCE_COMPARE modes are used for comparing the effect of video enhancement.

102

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.62 LONG WINAPI AVerGetVideoEnhanceMode(HANDLE hCaptureObject, DWORD

*pdwMode)

Get the current video enhancement mode.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object pdwMode Return the current video enhancement mode

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter

103

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.63 LONG WINAPI AVerSetVideoMirrorMode(HANDLE hCaptureObject, DWORD

dwMode)

Set the video mirroring mode.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object dwMode Specify the video mirroring mode, valid values are:

VIDEOMIRROR_NONE, VIDEOMIRROR_HORIZONTAL, VIDEOMIRROR_VERTICAL, VIDEOMIRROR_BOTH

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_ERROR_STATE The video capture card is not working CAP_EC_UNKNOWN_ERROR Unknown error

104

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

Introduction

There are four video mirroring modes: VIDEOMIRROR_NONE: no video mirroring will be applied VIDEOMIRROR_HORIZONTAL: horizontal video mirroring is applied VIDEOMIRROR_VERTICAL: vertical video mirroring is applied VIDEOMIRROR_BOTH: both horizontal and vertical video mirroring are applied

105

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.64 LONG WINAPI AVerGetVideoMirrorMode(HANDLE hCaptureObject, DWORD

*pdwMode)

Get the current video mirroring mode.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object pdwMode Return the current video mirroring mode

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter

 

106

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.65 LONG WINAPI AVerSetMpeg2VideoEncoderInfo(HANDLE hCaptureObject,

MPEG2_VIDEOENCODER_INFO *pVideoEncoderInfo) Set the properties of the video encoder for recording Mpeg2 files.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object pVideoEncoderInfo Set the properties of the video encoder. Read the remarks for details

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter

107

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

Introduction

Set the properties of the video encoder in MPEG2_VIDEOENCODER_INFO structure. Here are the details of each member:

Member Variable Description dwVersion Specify the version number of the structure. Different version

number results in different definition of the structure. Currently, dwVersion must be set to 1

dwBitrate Specify the birate of the video stream, in units of Kbps  

The table below lists the valid bitrate ranges for different video resolutions (if users set the bitrate out of the valid range, this function will return CAP_EC_INVALID_PARAM): NO. Resolution Bitrate(Kbps)1 Size <= 720*576 2000~15000 2 720*576 <Size<= 1024*768 4000~25000 3 Size > 1024 *768 8000~40000 The reference table below lists the common bitrate setting for each resolution NO. Resolution Bitrate(Kbps) 1 640X480 4500 2 704X576 6000 3 720X480 5000 4 720X480P 10000

108

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

109

NO. Resolution Bitrate(Kbps) 5 720X576 6000 6 720X576P 12000 7 1280X720P 28000 8 1920X1080 30000 9 1024X768P 24000 10 1280X800P 30000 11 1280X1024P 38000 12 1440X900P 38000 13 1600X1200P 28000 14 1680X1050P 26000 15 1920X1080P 30000 16 1920X1080P_24FPS 30000 17 640X480P 9000 18 800X600P 14000 19 1280X768P 30000 20 1360X768P 30000 Important Notes: 1. In this version of SDK, the video format contained in the Mpeg2 file is MPEG-2 Video. 2. In MPEG-2 specification, the supported maximum video height is limited to 1152. So if the input video height is larger than 1152, users must call AVerSetVideoDownscaleMode() to shrink the video size before recording.

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

3. In MPEG-2 specification, the standard video frame rates 23.976, 24, 25, 29.97, 30, 50, 59.94, 60 are defined, while other non-standard frame rates are not defined. Namely, in our SDK, non-standard video frame rates are not supported during the Mpeg2 files recording (may not generate any recorded file). 4. For input frame rate of 35(1680*1050P), the frame rate in the recorded Mpeg2 file will be 29.97.

110

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.66 LONG WINAPI AVerGetMpeg2VideoEncoderInfo(HANDLE hCaptureObject,

MPEG2_VIDEOENCODER_INFO *pVideoEncoderInfo) Get the properties of the video encoder for recording Mpeg2 files.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object pVideoEncoderInfo Return the properties of the video encoder

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter

Introduction

In this version of SDK, the dwVersion member in MPEG2_VIDEOENCODER_INFO structure (pointed to by pVideoEncoderInfo) must be set to 1 when calling this function, otherwise, it will return CAP_EC_INVALID_PARAM.

111

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.67 LONG WINAPI AVerSetMpeg2AudioEncoderInfo(HANDLE hCaptureObject,

MPEG2_AUDIOENCODER_INFO *pAudioEncoderInfo) Set the properties of the audio encoder for recording Mpeg2 files.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object pAudioEncoderInfo Set the properties of the audio encoder. Read the remarks for details

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter

112

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

Introduction

Set the properties of the audio encoder in MPEG2_AUDIOENCODER_INFO structure. Here are the details of each member:

Member Variable Description dwVersion Specify the version number of the structure. Different version

number results in different definition of the structure. Currently, dwVersion must be set to 1

dwBitrate Specify the birate of the audio stream.

113

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.68 LONG WINAPI AVerGetMpeg2AudioEncoderInfo(HANDLE hCaptureObject,

MPEG2_AUDIOENCODER_INFO *pAudioEncoderInfo) Get the properties of the audio encoder for recording Mpeg2 files.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object pAudioEncoderInfo return the properties of the audio encoder

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter

Introduction

In this version of SDK, the dwVersion member in MPEG2_AUDIOENCODER_INFO structure (pointed to by pAudioEncoderInfo) must be set to 1 when calling this function, otherwise, it will return CAP_EC_INVALID_PARAM.

 

114

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.69 LONG WINAPI AVerSetMpeg4VideoEncoderInfo(HANDLE hCaptureObject,

MPEG4_VIDEOENCODER_INFO *pVideoEncoderInfo) Set the properties of the video encoder for recording Mpeg4 files.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object pVideoEncoderInfo Set the properties of the video encoder. Read the remarks for

details

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter

115

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

Introduction

Set the properties of the video encoder in MPEG4_VIDEOENCODER_INFO structure. Here are the details of each member:

Member Variable Description dwVersion Specify the version number of the structure. Different version

number results in different definition of the structure. Currently, dwVersion must be set to 1

dwBitrate Specify the birate of the video stream, in units of Kbps. Valid values are in the range of (0, 20000]

The reference table below lists the common bitrate setting for each resolution NO. Resolution Bitrate(Kbps) 1 640X480 2500 2 704X576 3000 3 720X480 2500 4 720X480P 5000 5 720X576 3000 6 720X576P 6000 7 1280X720P 14000 8 1920X1080 15000 9 1024X768P 13000 10 1280X800P 15000

116

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

117

NO. Resolution Bitrate(Kbps) 11 1280X1024P 19000 12 1440X900P 19000 13 1600X1200P 14000 14 1680X1050P 13000 15 1920X1080P 15000 16 1920X1080P_24FPS 15000 17 640X480P 4500 18 800X600P 7000 19 1280X768P 15000 20 1360X768P 15000 Important Notes: 1. In this version of SDK, the video format contained in the Mpeg4 file is H.264. 2. For video resolutions supported by the capture card, if the size is smaller than or equal to 720*576, the aspect ratio will be set to 4:3 in the recorded Mpeg4 files, otherwise, it will be set to 16:9. If users have called AVerSetVideoClippingRect(), AverSetVideoRotateMode(), AVerSetVideoDownscaleMode() or AverSetVideoUpscaleBlackRect() to clip, rotate, downscale video or pad video with black strips before recording, the video aspect ratio in the recorded Mpeg4 file will be recalculated.

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.70 LONG WINAPI AVerGetMpeg4VideoEncoderInfo(HANDLE hCaptureObject,

MPEG4_VIDEOENCODER_INFO *pVideoEncoderInfo) Get the properties of the video encoder for recording Mpeg4 files.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object pVideoEncoderInfo Return the properties of the video encoder

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter

Introduction

In this version of SDK, the dwVersion member in MPEG4_VIDEOENCODER_INFO structure (pointed to by pVideoEncoderInfo) must be set to 1 when calling this function, otherwise, it will return CAP_EC_INVALID_PARAM.

118

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.71 LONG WINAPI AVerSetMpeg4AudioEncoderInfo(HANDLE hCaptureObject,

MPEG4_AUDIOENCODER_INFO *pAudioEncoderInfo) Set the properties of the audio encoder for recording Mpeg4 files.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object pAudioEncoderInfo Set the properties of the audio encoder. Read the remarks for details

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter

119

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

Introduction

Set the properties of the audio encoder in MPEG4_AUDIOENCODER_INFO structure. Here are the details of each member:

Member Variable Description dwVersion Specify the version number of the structure. Different version

number results in different definition of the structure. Currently, dwVersion must be set to 1

dwBitrate Specify the birate of the audio stream. Important Notes: 1. In this version of SDK, the audio format contained in the Mpeg4 file is AAC.

120

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.72 LONG WINAPI AVerGetMpeg4AudioEncoderInfo(HANDLE hCaptureObject,

MPEG4_AUDIOENCODER_INFO *pAudioEncoderInfo) Get the properties of the audio encoder for recording Mpeg4 files.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object pAudioEncoderInfo return the properties of the audio encoder

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter

Introduction

In this version of SDK, the dwVersion member in MPEG4_AUDIOENCODER_INFO structure (pointed to by pAudioEncoderInfo) must be set to 1 when calling this function, otherwise, it will return CAP_EC_INVALID_PARAM.

121

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.73 LONG WINAPI AVerSetVideoRotateMode(HANDLE hCaptureObject, DWORD

dwMode) Set the mode of video rotation.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object dwMode Specify the mode of video rotation, valid values are:

VIDEOROTATE_NONE, VIDEOROTATE _CW90, VIDEOROTATE _CCW90

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_ERROR_STATE The video capture card is working

122

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

Introduction

Modes of video rotation are: VIDEOROTATE_NONE: no rotation VIDEOROTATE _CW90: rotate 90 degrees clockwise VIDEOROTATE _CCW90: rotate 90 degrees counter-clockwise Important Notes: 1. If users have called AVerSetVideoClippingRect() to clip the video, then rotation will be done after the clipping.

123

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.74 LONG WINAPI AVerGetVideoRotateMode(HANDLE hCaptureObject, DWORD

*pdwMode) Get the current mode of video rotation.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object pdwMode Return the current mode of video rotation

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter

124

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.75 LONG WINAPI AVerSetVideoUpscaleBlackRect(HANDLE hCaptureObject, RECT

rcUpscaleRect) Set the rectangle region that will be padded with black strips during video upscaling.

Parameter

Name Description hCaptureObject Specify a handle for the video capture object rcUpscaleRect Specify the rectangle that will be padded with black strips. See

remarks below for details.

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter CAP_EC_ERROR_STATE The video capture card is working

125

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

Introduction

This function, through padding black strips to the outside of the original video, upscalses the video to a larger size. The ‘Left’ and ‘Top’ parameters of the rectangle must be less than or equal to 0, which denotes padding black strips to the left and top side of the original video; the ‘Right’ and ‘Bottom’ parameters of the rectangle must be larger than or equal to the original video’s width and height, which denotes padding black strips to the right and bottom side of the original video. The width and height of the final upscaled video must be in multiple of 16 (the height can be 1080 if the size is 1920*1080). If users have ever called this function to upscale the video, they can cancel it by calling this function again with the four parameters (Left, Top, Right, Bottom) of the rectangle all set to 0. Important Notes: 1. If users have called AVerSetVideoClippingRect() to clip the video, then upscaling will be done after the clipping. 2. If users have called AVerSetVideoRotateMode () to rotate the video, then upscaling will be done after the rotation. 3. If users have called AVerSetVideoDownscaleMode () to downscale the video, then upscaling will be done after the

downcaling.

126

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

2.76 LONG WINAPI AVerGetVideoUpscaleBlackRect(HANDLE hCaptureObject, RECT

*prcUpscaleRect) Get the rectangle which denotes the black-strip region

Parameter

Name Description hCaptureObject Specify a handle for the video capture object prcUpscaleRect Return the rectangle which denotes the black-strip region.

Return Value

Value Description CAP_EC_SUCCESS Success CAP_EC_INVALID_PARAM Invalid input parameter

Introduction

If users have not called AVerSetVideoUpscaleBlackRect() beforehand, calling this function will return the clipped, rotated, or downscaled video size (if there’re such kind of operations).

127

AAVVeerrMMeeddiiaa  CCaappttuurree  CCaarrdd  SSooffttwwaarree  DDeevveellooppmmeenntt  KKiitt   

3. Error Code All error codes indicate unsuccessful function calls other than CAP_EC_SUCCESS. The following table shows all error codes: Return Value Description CAP_EC_SUCCESS Success CAP_EC_INIT_DEVICE_FAILED Fail to initialize capture card CAP_EC_DEVICE_IN_USE Selected capture card is in use now CAP_EC_NOT_SUPPORTED Unsupported operation CAP_EC_INVALID_PARAM Invalid parameter CAP_EC_TIMEOUT Operation is timeout CAP_EC_NOT_ENOUGH_MEMORY Not enough memory CAP_EC_UNKNOWN_ERROR Unknown error CAP_EC_ERROR_STATE Working state error

128