PCI-MP4S 4-CH MPEG4 Software Video Compression Card User’s Manual Manual Rev. 2.00 Revision Date: January 7, 2005 Part No: 50-15029-101 Advance Technologies; Automate the World.
Copyright 2005 ADLINK TECHNOLOGY INC. All Rights Reserved. The information in this document is subject to change without prior notice in order to improve reliability, design, and function and does not represent a commitment on the part of the manufacturer. In no event will the manufacturer be liable for direct, indirect, special, incidental, or consequential damages arising out of the use or inability to use the product or documentation, even if advised of the possibility of such damages.
Getting Service from ADLINK Customer Satisfaction is top priority for ADLINK Technology Inc. Please contact us should you require any service or assistance. ADLINK TECHNOLOGY INC. Web Site: http://www.adlinktech.com Sales & Service: Service@adlinktech.com TEL: +886-2-82265877 FAX: +886-2-82265717 Address: 9F, No. 166, Jian Yi Road, Chungho City, Taipei, 235 Taiwan Please email or FAX this completed service form for prompt and satisfactory service.
Table of Contents Table of Contents..................................................................... i List of Tables.......................................................................... iv List of Figures ......................................................................... v 1 Introduction ........................................................................ 1 1.1 1.2 1.3 1.4 Features............................................................................... 2 Image Acquisition .....
2.2 2.3 PCI-MP4S Standard Accessories ................................. 19 PCI-MP4S Connectors and Pin Definitions .................. 20 RTV-E4 Extension board for RTV-24 and PCI-MP4S........ 23 RTV-E4 Connectors and Pin Definitions ....................... 23 RTV-I4 Isolation GPIO board for RTV-24 and PCI-MP4S . 24 RTV-I4 Connectors and Pin Definitions ........................ 24 Input 2R10P pin header pin definition: .......................... 26 D-sub 25-pin output connector pin .........................
5.4 AngeloMPEG4_Decode_Connect – ............................. 79 AngeloMPEG4_Decode_Disconnect – ......................... 79 AngeloMPEG4_Decode_Set_Callback– ...................... 81 AngeloMPEG4_Decode_Set_Image_Config– .............. 84 AngeloMPEG4_Decode_Set_Motion_Detection– ........ 87 AngeloMPEG4_Decode_Get_Config– ......................... 90 AngeloMPEG4_Decode_Start– .................................... 93 AngeloMPEG4_Decode_Stop– ....................................
List of Tables Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table iv 1-1: 1-2: 1-3: 1-4: 1-5: 1-6: 1-7: 1-8: 2-1: 2-2: 2-3: 2-4: 2-5: 2-6: 2-7: 2-8: 2-9: 2-10: 2-11: 2-12: 5-1: 5-2: 5-3: 5-4: Acquisition Speed ..................................................... 2 Quality Index ............................................................. 3 Video Format: QCIF (160*120) .................................
List of Figures Figure 2-1: Figure 2-2: Figure 2-3: Figure 2-4: Figure 2-5: List of Figures 4-channel software trigger output ............................ PCI-MP4S Appearance ........................................... Watchdog reset cable, GPIO bracket, AIO CD........ RTV-E4.................................................................... RTV-I4 .....................................................................
1 Introduction The PCI-MP4S is a MPEG4 software video compression development kit that combines excellent real-time image acquisition and advanced MPEG4 software video compression algorithm for security and remote video surveillance applications. This 32-bit, 33MHz/66MHz PCI bus frame grabber simultaneously captures four video analog streams in real time. It accepts standard composite color (PAL, NTSC) or monochrome video format (CCIR, EIA) camera input.
1.
MPEG4 Encoding Quality Index: Quality Level NTSC 4CIF (640 x 480) CIF (320 x 240) QCIF (160 x 120) Lowest Bit-rate = 400000*4 Frame rate = 5 Bit-rate = 400000 Frame rate = 5 Bit-rate = 400000/4 Frame rate = 5 Low Bit-rate = 480000*4 Frame rate = 10 Bit-rate = 480000 Frame rate = 10 Bit-rate = 480000/4 Frame rate = 10 Normal Bit-rate = 560000*4 Frame rate =15 Bit-rate = 560000 Frame rate =15 Bit-rate = 560000/4 Frame rate =15 High Bit-rate = 560000*4 Frame rate = 30 Bit-rate = 560000 Frame
Save single image file: Supports save single image to BMP or JPEG image file format. MPEG4 Decoding MPEG4 video decoding: Video decoding can be assigned a source from the local memory buffer, file access, or TCP/IP port. The quality of decoded video can be used to adjust the video encoding level. Decoding quality can also be used to control the flow rate between encoder and decoder and to adjust motion detection settings.
I/O Lines The PCI-MP4S is fitted with TTL compatible I/O lines protected against overloads and electrostatic discharges. Each line may be configured for input or output. They can be used to trigger acquisitions or to report alarm signals. Supported Software WDM driver - Supports VC++/VB/BCB/Delphi programming under Windows NT/98/2000/XP platforms with DLL. ViewCreator - This package will assist in initial testing and functional evaluation. 1.
1.3 System requirement For real-time* to compression 4-CH color MPEG4 video requirement, the PCI-MP4S minimum system requirement are as follows: X Platform: Pentium 4, 2.4GHz CPU, 256MB DDRAM above. X VGA display: AGP 4X above (No recommend VIA or SiS VGA chipset solution). X Display setting: 800 x 600 above resolution, 16-bit above color format. X OS: if OS uses Windows 2000 then please upgrade to Service Pack 4.0 or above.
Video Format: QCIF (160*120) # Port CPU loading Quality Encoding (max.
12 13 Lowest 34 OK OK Low 42 OK OK Normal 61 OK OK High 91 OK OK Highest 91 OK OK Lowest 45 OK OK Low 58 OK OK Normal 72 OK OK High 100* - - Highest 100* - - Table 1-3: Video Format: QCIF (160*120) * When CPU loading up to 100% then will start have time-lapse effect.
Video Format: CIF(320*240) # Port Quality Encoding Lowest 1 2 3 4 5 CPU loading (max.
Video Format: 4CIF(640*480) # Port Encoding 1 2 Quality CPU loading (max. %) Lowest Decoding Microsoft Media Player ADLINK M4V Player 22 OK OK Low 39 OK OK Normal 50 OK OK High 86 OK OK Highest 88 OK OK Lowest 42 OK OK Low 63 OK OK Normal 67 OK OK High 100* - - Highest 100* - - Table 1-5: Video Format: 4CIF(640*480) * When CPU loading up to 100% then will start have time-lapse effect.
Video Format: QCIF (160*120) # Port CPU loading Quality Encoding (max.
12 16 Lowest 18 OK OK Low 25 OK OK Normal 33 OK OK High 58 OK OK Highest 55 OK OK Lowest 28 OK OK Low 45 OK OK Normal 61 OK OK High 87 OK OK Highest 86 OK OK Table 1-6: Video Format: QCIF (160*120) 12 Introduction
Video Format: CIF(320*240) # Port Encoding 1 2 3 4 5 Quality CPU loading (max.
Lowest 6 7 29 OK OK Low 38 OK OK Normal 52 OK OK High 92 OK OK Highest 98 OK OK Lowest 33 OK OK Low 44 OK OK Normal 59 OK OK High 100* - - Highest 100* - - Table 1-7: Video Format: CIF(320*240) * When CPU loads up to 100%, the time-lapse effect would commence.
Video Format: 4CIF(640*480) # Port Encoding 1 2 3 Quality CPU loading (max.
16 Introduction
2 Hardware Reference 2.
Watch Dog Timer X For monitoring applications – will reset the PC after a programmable inactivity time-out.
PCI-MP4S Appearance Figure 2-2: PCI-MP4S Appearance PCI-MP4S Standard Accessories X Watch dog reset cable X GPIO bracket X User’s Manual X All in One CD Figure 2-3: Watch dog reset cable, GPIO bracket, All in One CD Hardware Reference 19
PCI-MP4S Connectors and Pin Definitions Video Inputs Connector Definition Video IN – CH 0 Video IN – CH 1 Video IN – CH 2 Video IN – CH 3 Table 2-2: Video Inputs Channel Extension Video Input (CN2) Pin Function Pin Function 1 GND 2 CH4 video in 9 1 3 CH5 video in 4 GND 10 2 5 GND 6 CH6 video in 7 CH7 video in 8 GND 9 GND 10 GND Table 2-3: Channel Extension Video Input (CN2) 20 Hardware Reference
Channel Extension Video Input (CN3) Pin Function Pin Function 1 GND 2 CH8 video in 9 1 3 CH9 video in 4 GND 10 2 5 GND 6 CH10 video in 7 CH11 video in 8 GND 9 GND 10 GND Table 2-4: Channel Extension Video Input (CN3) Channel Extension Video Input (CN5) Pin Function Pin Function 1 GND 2 CH12 video in 9 1 3 CH13 video in 4 GND 10 2 5 GND 6 CH14 video in 7 CH15 video in 8 GND 9 GND 10 GND Table 2-5: Channel Extension Video Input (CN5) GPIO (CN8) 9 1
GPIO (CN9) 9 1 10 2 Pin Function Pin Function 1 IN2 (External interrupt) 2 GND 3 OUT2 4 Software Trigger 2 5 IN3 (External interrupt) 6 Software Trigger 3 7 OUT3 8 +5V 9 GND 10 -- Table 2-7: GPIO (CN9) Watchdog Timer Reset Pin Function 1 System reset 2 GND Table 2-8: Watchdog Timer Reset 22 Hardware Reference
2.
2.
Relay I/O voltage requirement: X Input: +5V to +24V X Output: AC: 0.5A/125V, DC: 1A/30V or 0.
Trigger output voltage: 0V to +5V Input 2R10P pin header pin definition: GPIO (CN1) Pin Function Pin Function 1 GPIO Input 1 2 GND 9 1 3 GPIO Output 1 4 PORT1 STRG Output 10 2 5 GPIO Input 2 6 PORT2 STRG Output 7 GPIO Output 2 8 VCC 9 GND 10 NC Table 2-10: GPIO (CN1) GPIO (CN2) Pin Function Pin Function 1 GPIO Input 3 2 GND 9 1 3 GPIO Output 3 4 PORT3 STRG Output 10 2 5 GPIO Input 4 6 PORT4 STRG Output 7 GPIO Output 4 8 VCC 9 GND 10 NC Table 2-11: GP
D-sub 25-pin output connector pin Pin Signal name Pin Signal name 1 DI1 14 RY3_COM 2 DI1_COM 15 RY4 3 DI2 16 RY4_COM 4 DI2_COM 17 STRG_OUT1 5 DI3 18 STRG_OUT2 6 DI3_COM 19 STRG_OUT3 7 DI4 20 STRG_OUT4 8 DI4_COM 21 STRG_GND 9 RY1 22 STRG_GNG 10 RY1_COM 23 NC 11 RY2 24 NC 12 RY2_COM 25 NC 13 RY3 26 Table 2-12: D-sub 25-pin output connector pin Hardware Reference 27
28 Hardware Reference
3 Installation Guide 3.1 Hardware Installation PCI-MP4S Use the following steps to install the PCI-MP4S board on the PCI bus: 1. Remove the computer cover using the instructions from the computer manual. 2. Check that there is an empty PCI (32-bit) slot to accommodate the board. If there is no empty slot, remove a PCI board from the computer to make room for the PCIMP4S board and note the chosen slot number (i.e. card index). 3.
5. Once perfectly aligned with an empty slot, press the board firmly but carefully into the connector. 6. Anchor the board by replacing the screw. 7. Connect your video sources for image acquisition tests. For details, refer to the “ViewCreator” utility. 8. Turn on the computer. In some cases, when the computer boots up, the “Plug and Play” feature of Windows will detect the new PCI card eight times (four videos and four audios) and you will require drivers. For details, see the “Installation Guide.” 3.
2. Select Vision.
3. Click Angelo 4. Select Windows Driver for Windows 98/NT/2000/XP.
5. The driver will begin installing. 6. Click Next until the driver installs completely.
34 Installation Guide
Installation Guide 35
7. Click Finish and restart the system.
X The Found New Hardware Wizard window appears after system restarts. Click NEXT and follow the following steps to complete the new hardware wizard.
Z 38 Click Next.
X Z Click Next. Z Click Finish. Another Found New Hardware Wizard window appears when you finished the wizard. Repeat step 7.1 until you finished all wizards. 8. Go to the System Control Panel and check to see that four “ADLINK Angelo Audio Device” and four “ADLINK Angelo Video Device” are installed as shown.
X 40 If you see a yellow question mark appear in front of the new driver’s name, you need to setup the driver manually.
X Right click on the driver name, Multimedia Controller which is a audio device, then select Properties on the popup menu. Follow the steps below to complete the driver re-installment.
42 Z Click Reinstall Driver. Z Click Next.
Z Click Next. Z Check Specify a location then click Next. Z In Copy manufacture’s files from: text box insert the location of driver installed in step 6, for example, ‘c:\Program Files\ADLINK\Angelo.RTV\Drivers\Win2KXP’.
Then click OK. Z 44 Click Next.
Z Click Finish to complete this wizard. Z This device is working properly. Z The yellow question mark disappears.
X Right click on the driver name, Multimedia Video Controller which is a video device. Repeat step 8.2 onwards. X Repeat steps 8.2 and 8.3 until all audio devices and video devices are working properly. Note: If the system prompts you to restart the computer, select No until all drivers are reinstalled, then restart the computer. 9. XVID CODEC User must install the XVID CODEC in our setup disk in order to play “.avi” file in Microsoft Media Player.
4 ViewCreator Utility Once hardware installation is complete, ensure that the system is correctly configured before running the ViewCreator utility. This chapter outlines how to set up a vision system and manually control Angelo series cards to verify correct operation. ViewCreator provides a simple yet powerful means to setup, configure, test, and debug the vision system. Note: ViewCreator is only available for Windows 98/NT/2k/ XP with a recommended screen resolution of 800x600 or higher. 4.
4.2 Component Description Tree Browser The Tree Browser window lists the PCI-MP4S cards and video ports available at the local computer. Image View The Image View window displays Full, CIF, and QCIF size images and image effects. Control Panel The control panel allows for making video adjustments, including brightness, hue, contrast, etc. 4.3 Operation Theory ViewCreator provides many functions for the Angelo series card as described below.
MPEG4 Encoding Single channel display X Click a video Port icon in the Tree Browser window. A video frame will appear in the Image View window. X Select Encoder->Encode in menu bar to bring up the Encoder Setting dialog box, then click the start button. Note: 1. View Creator supports only one channel CIF video encoding. Ensure there is only one channel, CIF image on the screen. 2. Execute the decoder sample program in Program files->ADLINK->AngeloMPEG4->Samples to connect to the encoder (IP:127.0.0.
Video adjustments Hue Click and hold the left mouse button on the Hue slider of the Control Panel and drag the cursor to change its value. Values range from 0 to 255. Contrast Click and hold the left mouse button on the Contrast slider of the Control Panel and drag the cursor to change its value. Values range from 0 to 255. Brightness Click and hold the left mouse button on the Brightness slider of the Control Panel and drag the cursor to change its value. Values range from 0 to 255.
Cross Line Check the Cross Line check box in the Control Panel. A crosshair will appear in the center of the rectangle. Tools GPIO and LED X Click Tool in the menu bar and select GPIO & LED to bring up the GPIO dialog box. Select the port to access and select the digital output value. Click either the write or read button to write/read to/from the digital I/O ports. X LED status is only supported with the cPCI Angelo series card.
52 ViewCreator Utility
5 Function Library This chapter describes the API for Mpeg4 encode and decode. Users can use these functions to develop application programs under Visual C++, Visual Basic, C++ Builder, and Delphi. 5.
Category Function AngeloMPEG4_Decode_Set_Callback(Decoder_Index, CallBackProc) AngeloMPEG4_Decode_Connect(Decoder_Index,Encoder_IP, Encoder_Index) AngeloMPEG4_Decode_Disconnect(Decoder_Index) AngeloMPEG4_Decode_Set_Image_Config(Decoder_Index, ConfigIndex , Value) AngeloMPEG4_Decode_Set_Motion_Detection(Decoder_Index, Area, enable, Threshold, interval,action, X_Start, Y_Start, Width, Height) AngeloMPEG4_Decode_Get_Config(Decoder_Index,iWidth, iHeight, video_format, color_format,Bitrate, frame_rate) AngeloMP
Category Function System (Section 5.4) AngeloMPEG4_Get_Version( Mpeg4_DLLVersion, AngeloRTV_DLLVersion, Reserved) Table 5-1: List of Functions 5.2 Encode Functions @ Name AngeloMPEG4_Encode_Initial(Encoder_Index, Local_Address, Quality , Angelo_PortNo, Angelo_ChannelNo, Angelo_Color_Format, Angelo_Video_Format): Initialize the encoder.
AngeloMPEG4_Encode_Set_Motion_Detection(Encode r_Index, Area, enable, Threshold, interval, action, X_Start, Y_Start, Width, Height): Set the motion detection criteria, and action when motion occurs on the encode site. @ Description AngeloMPEG4_Encode_Initial: This function initializes the video encoder. Its library supports 16 video encoders with the video source coming from Angelo_PortNo and Angelo_ChannelNo in the Angelo cards. Quality, and Angelo_Color_Format are parameters for encoder setting.
AngeloMPEG4_Encode_Save_File_Start: Use this function to save the encoded image into an “.avi” or “.m4v” video file. The “.avi” file is the standard video format, and “.m4v” is only accessible in this function library. Note: 1. Do not add a file extension to the file name. 2. User must install the XVID Codec in our setup disk in order to play “.avi” file in MS Media Player. AngeloMPEG4_Encode_Save_File_Stop: Use this function to stop saving the video file.
Angelo_Color_Format, int Angelo_Video_Format) int AngeloMPEG4_Encode_InitialEx(int Encoder_Index, char* Local_Address, int Bitrate, int frame_rate, int Angelo_PortNo, int Angelo_ChannelNo, int Angelo_Color_Format, int Angelo_Video_Format); Visual Basic (Windows 98/NT/2000/XP) AngeloMPEG4_Encode_Initial(ByVal Encoder_Index As Long, ByVal Local_address As String, ByVal Quality As Long, ByVal Angelo_PortNo As Long, ByVal Angelo_ChannelNo As Long, ByVal Angelo_Color_Format As Long, ByVal Angelo_Video_Format As
@ Argument Encoder_Index: Indicates the channel index for the MPEG4 encoder. The range of channels is 0 – 15. Local_Address: Indicates the IP Address at the encoding site. Set 0, NULL or nil for default setting.
Bitrate: Indicates the number of bits per second. frame_rate: Indicates the number of frames that the MPEG4 encoder will encode per second. The range of the frame_rate is 1 – 30. Angelo_PortNo: The port number is the zero index of the Angelo series card. For example, if there are two PCI-RTV-24 Angelo cards (card 0, card 1) in the system, and each PCIRTV-24 has four ports, the first port of card 0 is “0”, and the first port of card 1 is “4.
int Bitrate = 480000; int frame_rate = 15; Result = AngeloMPEG4_Encode_Initial (Encoder_Index, Quality, Angelo_PortNo, Angelo_ChannelNo, Angelo_Color_Format, Angelo_Video_Format); Result = AngeloMPEG4_Encode_InitialEx (Encoder_Index, Bitrate, frame_rate, Angelo_PortNo, Angelo_ChannelNo, Angelo_Color_Format, Angelo_Video_Format); < Visual Basic > Dim result As Long Dim Encoder_Index As Long, Quality As Long, Angelo_PortNo As Long, Angelo_ChannelNo As Long, Angelo_Color_Format As Long, Angelo_Video_Format A
< Delphi > Var Encoder_Index, Result: Longint; Quality: Longint; Bitrate, frame_rate: Longint; Angelo_PortNo, Angelo_ChannelNo: Longint; Angelo_Color_Format, Angelo_Video_Format: Longint; begin Encoder_Index:= 0; Quality := 0; // Normal Quality Bitrate := 480000; frame_rate := 15; Angelo_PortNo := 0; Angelo_ChannelNo := 0; Angelo_Color_Format := 3; // RGB24 Angelo_Video_Format := 2; // CIF, NTSC Result := AngeloMPEG4_Encode_Initial(Encoder_Index, Quality, Angelo_PortNo, Angelo_ChannelNo, Angelo_Color_Format
Visual Basic (Windows 98/NT/2000/XP) AngeloMPEG4_Encode_Set_Callback (ByVal Encoder_Index As Long, ByVal Encode_CallBackProcas As Long) As Long Delphi (Windows 98/NT/2000/XP) AngeloMPEG4_Encode_Set_Callback(Encoder_Index:Lo ngint; lpEncodeCallBackProc:EncodeCallBackProc):Lo ngint; @ Argument Encoder_Index: Indicates the channel Index for the MPEG4 encoder. The range of channels is 0 – 15.
< Visual Basic > Dim Encoder_Index As Long, Result As Long Public Sub encode_callback(ByVal Encoder_Index As Long, ByVal int_status As Long, param_str As param_struct) Select Case (int_status) Case 1: “preview Case 16: “ motion detection End Select End Sub Channel =0 Result = AngeloMPEG4_Encode_Set_Callback(Encoder_Ind ex, Encode_Callback) < Delphi > procedure Encode_Callback (Encoder_Index:Longint;int_status:Longint;v ar param_struct:param_str);stdcall var {* add your var here *} begin case int_status of
// Main Code var Encoder_Index, Result: Longint; begin Encoder_Index:= 0; Result := AngeloMPEG4_Encode_Set_Callback(Encoder_Ind ex, Encode_Callback); end; AngeloMPEG4_Encode_Start– AngeloMPEG4_Encode_Stop– AngeloMPEG4_Encode_Close– @ Syntax C/C++ (Windows 98/NT/2000/XP) int AngeloMPEG4_Encode_Start(int Encoder_Index); int AngeloMPEG4_Encode_Stop(int Encoder_Index); int AngeloMPEG4_Encode_Close(int Encoder_Index); Visual Basic (Windows 98/NT/2000/XP) AngeloMPEG4_Encode_Start (ByVal Encoder_Index As Long) A
@ Argument Channel: Indicates the channel index for the MPEG4 encoder. The range of channels is 0 – 15.
Result := AngeloMPEG4_Encode_Close(Encoder_Index); end; AngeloMPEG4_Encode_Save_File_Start– AngeloMPEG4_Encode_Save_File_Stop– AngeloMPEG4_Encode_Create_Directory– @ Syntax C/C++ (Windows 98/NT/2000/XP) int AngeloMPEG4_Encode_Save_File_Start(int Encoder_Index, char* n_file_name, long interval_second, long format); int AngeloMPEG4_Encode_Save_File_Stop(int Encoder_Index); int AngeloMPEG4_Encode_Create_Directory(int Encoder_Index, char* Dir); Visual Basic (Windows 98/NT/2000/XP) AngeloMPEG4_Encode_Save_Fil
AngeloMPEG4_Encode_Create_Directory(Encoder_Inde x:Longint; Dir:String):Longint; @ Argument Encoder_Index: Indicates the channel index for the MPEG4 encoder. The range of channels is 0 – 15. n_file_name: The argument is the path and name of the file that the encoded image will be saved to. interval_second: This argument is the number of seconds of encoded video to be saved. Format: The argument describes the format in which to save the file. 1. m4v file 2. avi file 3.
< Visual Basic > Dim Result As Long, Encoder_Index As Long, interval_second As Long, format As Long Encoder_Index = 0; n_file_name = “test” interval_second = 60 format = 3 “save both format Dir = “temp” Result = AngeloMPEG4_Encode_Save_File_Start(Encoder_ Index, n_file_name, interval_second, format) < Delphi > Var Encoder_Index, Result: Longint; Dir, n_file_name: String; interval_second, format: Longint; begin Encoder_Index:= 0; Dir := “C:\VideoDir”; n_file_name := Dir + “\” + “Video0”; interval_second :=
AngeloMPEG4_Encode_Set_Motion_Detection– @ Syntax C/C++ (Windows 98/NT/2000/XP) int AngeloMPEG4_Encode_Set_Motion_Detection(int Encoder_Index,int Area,int enable, int Threshold,int interval,int action,int X_Start,int Y_Start,int Width,int Height); Visual Basic (Windows 98/NT/2000/XP) AngeloMPEG4_Encode_Set_Motion_Detection(ByVal Encoder_Index As Long, ByVal Area As Long, ByVal enable As Long, ByVal Threshold As Long, ByVal interval As Long, ByVal action As Long, ByVal X_Start As Long, ByVal Y_Start As Long
Threshold: Determines the sensitivity of motion detection measurement. The valid values are from 0 - 15, with 0 being the highest sensitivity. Interval: The time interval between measurements of motion detection. Action: This argument describes what actions the function will do. bit 0: Callback, X_Start, Y_Start, Width, Height: Sets the boundary of the motion detection area.
< Visual Basic > Dim Result As Long, Encoder_Index As Long, enable As Long, Threshold As Long, interval As Long, action As Long, area As Long, X_Start As Long, Y_Start As Long, Width As Long, Height As Long Encoder_Index = 0 enable = 1 Threshold = 5 interval = 3 action = 1 area =1 X_Start = 0 Y_Start =0 Width = 160 Height = 120 Result = AngeloMPEG4_Encode_Set_Motion_Detection(Enc oder_Index, area, enable, Threshold, interval, action, X_Start, Y_Start, Width, Height) var Encoder_Index, Result: Lo
Width = 160; Height = 120; if (enable = 1) then Result = AngeloMPEG4_Encode_Set_Motion_Detection(Enc oder_Index, area, enable, Threshold, interval, action, X_Start, Y_Start, Width, Height) else // disable motion detection Result = AngeloMPEG4_Encode_Set_Motion_Detection(Enc oder_Index, area, 0, Threshold, interval, action, X_Start, Y_Start, Width, Height); end; Function Library 73
5.3 Decode Functions @ Name AngeloMPEG4_Decode_Set_Callback(Decoder_Index, CallBackProc) – Setup the callback function for decoder. AngeloMPEG4_Decode_Connect(Decoder_Index, Encoder_IP, Encoder_Index) – Connect to the encoder. AngeloMPEG4_Decode_Disconnect(Decoder_Index) – Disconnect from the encoder. AngeloMPEG4_Decode_Set_Image_Config(Decoder_In dex, ConfigIndex , Value) – Adjust the brightness, contrast, hue etc..
AngeloMPEG4_Decode_Save_File_Start(Decoder_Ind ex, n_file_name, interval_second, format) – Start to save compressed file in decode site. AngeloMPEG4_Decode_Save_File_Stop(Decoder_Inde x) – Stop saving compressed file in decode site. AngeloMPEG4_Decode_File(Decoder_Index, file_name, iWidth, iHeight, Byte_Per_Pixel, Total_Frame,Time_Seconds) - Decode from *.avi or *.
AngeloMPEG4_Decode_ Connect: Use this function to establish a connection between decoder and encoder. The video date will then be transferred through this connection. AngeloMPEG4_Decode_ Disconnect: Use this function to close the connection between decoder and encoder. After closing the connection, the decoder will not receive video data from encoder.
automatically. Use this function to restart the video data transmission, if “AngeloMPEG4_Decode_Stop” has been called to stop the transmission. AngeloMPEG4_Decode_Stop: This function only stops the video data transmission between decoder and encoder, but the connection is still established. AngeloMPEG4_Decode_Get_FlowRate: If the connection between encoder and decoder is established, use this function to query the current data flow rate between encode and decode.
Note: 1. Do not add the file extension name. 2. Users must install the XVID Codec from the setup disk. The “.avi” file can be played in MS Media Player. AngeloMPEG4_Decode_Save_File_Stop: If the connection between encoder and decoder is established, use this function to stop saving video file on the decode site. In general, the video file will close automatically after the “Interval” parameter in AngeloMPEG4_Decode_Save_File_Start. AngeloMPEG4_Decode_File: If you save the video file into “.m4v” or “.
AngeloMPEG4_Decode_File_Pause: The file is paused until AngeloMPEG4_Decode_File_Continue is activated. AngeloMPEG4_Decode_File_Get_Position: Get the current frame index of the file. AngeloMPEG4_AVI_2_M4V: Use this function to translate a closed “.avi” video file into “.m4v” format. AngeloMPEG4_ M4V_2_AVI: Use this function to translate a closed “.m4v” video file into “.avi” format.
Delphi (Windows 98/NT/2000/XP) AngeloMPEG4_Decode_Connect(Decoder_Index:Longint ; Encoder_IP:String; Encoder_Index:Longint):Longint; AngeloMPEG4_Decode_Disconnect(Decoder_Index:Long int):Longint; @ Argument Decoder_Index: Indicates the channel number of MPEG4 Decoder. The range of channel is 0 - 15. Encoder_IP: The IP address of MPEG4 Encode. Encoder_Index: The channel of MPEG4 Encoder. @ Return Code 0: ERROR_NoError @ Example < VC/BCB > int Result; int channel = 0; char* Encoder_IP = “127.0.0.
var channel: Longint; Encoder_IP: String; Encoder_channel: Longint; Result: Longint; begin channel := 0; Remote_IP := ‘127.0.0.
int_status: Interrupt status: Bit 0: Image ready Bit 1: Motion Detection occur Bit 2: Connection establish @ Return Code 0: ERROR_NoError @ Example < VC/BCB > int Result; int channel = 0; void __stdcall Decode_Callback(int channel, long int_status, long VideoBufferaddress) { if((int_status & 0x01) == 1) //Image Ready { //Start Drawing memcpy(Temp,(PVOID)VideoBufferaddress,iWidt h*iHeight*3); gpDC>BitBlt(10,10,iWidth,iHeight,MemDC,0,0,SRCC OPY); } if((int_status>>1 & 0x01) == 1) // MotionDetection Occur { //
int Bitrate = 0, frame_rate = 0, colorspace = 0; AngeloMPEG4_Decode_Get_Config(channel, &iWidth, &iHeight, &videoformat, &colorspace, &Bitrate, &frame_rate); } } Result = AngeloMPEG4_Decode_Set_Callback(channel, Decode_Callback); < Visual Basic > Dim Result As Long, channel As Long Public Sub lpcallback(ByVal channel As Long, ByVal int_status As Long, ByVal VideoBufferaddress As Long) If int_status And &H2 Then 'detected motion ElseIf int_status And &H4 Then ' connect to encoder ElseIf int_status And &H1 T
Bitrate, Framerate, colorspace, videoformat: Longint; begin case int_status of 1: begin {********* image buffer OK *********} // draw image here end; 2: begin {********* Motion Detected *********} end; 4: begin {********* Connect Ready Interrupt *********} // You can get image config here and do somthing end; end; // end case int_status of end; // Main Code var channel: Longint; Result: Longint; begin channel := 0; Result := AngeloMPEG4_Decode_Set_Callback(channel, DecoderCallbackProc); end; AngeloMPEG4_De
Visual Basic(Windows 98/NT/2000/XP) AngeloMPEG4_Decode_Set_Image_Config(ByVal channel As Long, ByVal Decoder_Index As Long, ByVal Value As Long) As Long Delphi (Windows 98/NT/2000/XP) AngeloMPEG4_Decode_Set_Image_Config(Decoder_Inde x:Longint; ConfigIndex:Longint; Value:Longint):Longint; @ Argument Decoder_Index: Indicate the channel number of Decoder. The range of channel is 0 ~ 15.
@ Return Code 0: ERROR_NoError @ Example < VC/BCB > int Result; int channel = 0; int ConfigIndex = 0; int value = 128; Result = AngeloMPEG4_Decode_Set_Image_Config(channel , ConfigIndex, value); < Visual Basic > Dim Result As Long, channel As Long, ConfigIndex As Long, value As Long channel = 0 ConfigIndex = 0 value = 128 Result = AngeloMPEG4_Decode_Set_Image_Config(channel , ConfigIndex, value) var channel: Longint; ConfigIndex: Longint; Value: Longint; Result: Longint; begin channel := 0; Conf
AngeloMPEG4_Decode_Set_Motion_Detection– @ Syntax C/C++ (Windows 98/NT/2000/XP) int AngeloMPEG4_Decode_Set_Motion_Detection(int Decoder_Index,int Area,int enable, int Threshold,int interval,int action,int X_Start,int Y_Start,int Width,int Height); Visual Basic (Windows 98/NT/2000/XP) AngeloMPEG4_Decode_Set_Motion_Detection(ByVal Decoder_Index As Long, ByVal enable As Long, ByVal Threshold As Long, ByVal interval As Long, ByVal action As Long) As Long Delphi (Windows 98/NT/2000/XP) AngeloMPEG4_Decode_Set_M
Action: The argument descript what actions the function will do. bit 0: Callback, bit 1: Reserved, bit 2: Send motion frame Example: when action = 1 + 4, the function will perform callback and send the motion image. X_Start, Y_Start, Width, Height: Set the boundary of motion detection area.
channel = 0 enable = 1 Threshold = 5 interval = 3 action = 1 + 4 area =1 X_Start = 0 Y_Start =0 Width = 160 Height = 120 Result = AngeloMPEG4_Decode_Set_Motion_Detection(cha nnel, area, enable, Threshold, interval, action, X_Start, Y_Start, Width, Height) < Delphi > var channel, Result: Longint; enable, Threshold, interval, action: Longint, area:Longint, X_Star:Longint, Y_Start:Longint, Width: Longint, Height:Longint; begin channel := 0; enable := 1; Threshold := 5; Interval := 3; // 3 sec Action := 1+4; /
Result = AngeloMPEG4_Decode_Set_Motion_Detection(cha nnel, area, 0, Threshold, interval, action, X_Start, Y_Start, Width, Height); end; AngeloMPEG4_Decode_Get_Config– @ Syntax C/C++ (Windows 98/NT/2000/XP) int AngeloMPEG4_Decode_Get_Config(int Decoder_Index, int* iWidth, int* iHeight, int* video_format, int* color_format, int* Bitrate, int* frame_rate); Visual Basic(Windows 98/NT/2000/XP) AngeloMPEG4_Decode_Get_Config (ByVal Decoder_Index As Long, ByRef iWidth As Long, ByRef iHeight As Long, ByRef video_f
video_format: Full NTSC (640*480) Full PAL (768*576) CIF NTSC (320*240) CIF PAL (384*288) = 0, = 1, = 2, = 3, QCIF NTSC (160*120) = 4, QCIF PAL (192*144) = 5, color_format: RGB16 = 0, GRAY = 1, RGB15 = 2, RGB24 = 3, RGB32 = 4, RGB8 = 5, RAW8X = 6, YUY24:2:2 = 7, BtYUV 4:1:1 = 8 At present, we only provide RGB24 color format, hence the value should always be set at 3. Bitrate: Indicates the bitrate of MPEG4 stream from the encode server.
@ Return Code 0: ERROR_NoError @ Example < VC/BCB > int int int int int int int int Result; channel = 0; iWidth = 0; iHeight = 0; video_format = 0; color_format = 0; Bitrate = 0; frame_rate = 0; Result = AngeloMPEG4_Decode_Get_Config(channel, &iWidth, &iHeight, &videoformat, &color_format, &Bitrate, &frame_rate); < Visual Basic > Dim Result As Long, channel As Long, iWidth As Long, iHeight As Long, video_format As Long, color_format As Long, Bitrate As Long, frame_rate As Long Channel = 0 Result = Angelo
Result := AngeloMPEG4_Decode_Get_Config(channel, iWidth, iHeight, videoformat, colorspace, Bitrate, frame_rate); end; AngeloMPEG4_Decode_Start– AngeloMPEG4_Decode_Stop– @ Syntax C/C++ (Windows 98/NT/2000/XP) int AngeloMPEG4_Decode_Start(int Decoder_Index); int AngeloMPEG4_Decode_Stop(int Decoder_Index); Visual Basic(Windows 98/NT/2000/XP) AngeloMPEG4_Decode_Start(ByVal Decoder_Index As Long) As Long AngeloMPEG4_Decode_Stop(ByVal Decoder_Index As Long) As Long Delphi (Windows 98/NT/2000/XP) AngeloMPEG4_De
int Result; int channel = 0; Result = AngeloMPEG4_Decode_Start(channel); Result = AngeloMPEG4_Decode_Stop(channel); < Visual Basic > Dim Result As Long, channel As Long channel = 0 Result = AngeloMPEG4_Decode_Start(channel) Result = AngeloMPEG4_Decode_Stop(channel) < Delphi > var channel: Longint; Result: Longint; begin channel := 0; Result := AngeloMPEG4_Decode_Start(channel); Result := AngeloMPEG4_Decode_Stop(channel); end; AngeloMPEG4_Decode_Get_FlowRate– @ Syntax C/C++ (Windows 98/NT/2000/XP) int Ang
@ Argument Decoder_Index: Indicates the channel number of MPEG4 Decoder. The range of channel is 0 - 15. Byte_Second: The current flow rate of MPEG4 streaming measured in Byte/sec.
AngeloMPEG4_Decode_ ReInitial– AngeloMPEG4_Decode_ ReInitialEx– @ Syntax C/C++ (Windows 98/NT/2000/XP) int AngeloMPEG4_Decode_ReInitial(int Decoder_Index, int Quality, int Angelo_Video_Format); int AngeloMPEG4_Decode_ReInitialEx(int Decoder_Index, int Bitrate, int frame_rate, int Angelo_Video_Format); Visual Basic (Windows 98/NT/2000/XP) AngeloMPEG4_Decode_ReInitial (ByVal Decoder_Index As Long, ByVal Quality As Long, ByVal Video_Format As Long) As Long AngeloMPEG4_Decode_ReInitialEx (ByVal Decoder_Index A
Quality: Quality value image 640*480 image 320*240 image 160*120 Lowest -2 Bitrate = 320000*4 frame_rate = 3 Bitrate = 320000 frame_rate = 3 Bitrate = 240000/4 frame_rate = 3 Low -1 Bitrate = 400000*2 frame_rate = 6 Bitrate = 400000 frame_rate = 6 Bitrate = 400000/4 frame_rate = 6 Normal 0 Bitrate = 480000*4 frame_rate = 15 Bitrate = 480000 frame_rate = 15 Bitrate = 480000/4 frame_rate = 15 High 1 Bitrate = 512000*4 frame_rate = 30 Bitrate = 512000 frame_rate = 30 Bitrate = 512000/4 f
int Result; int channel = 0; int Quality =0 int Bitrate = 480000; int frame_rate = 15; int Angelo_Video_Format = 2; Result = AngeloMPEG4_Decode_ReInitia(channel, Quality, Angelo_Video_Format); Result = AngeloMPEG4_Decode_ReInitialEx(channel, Bitrate, frame_rate, Angelo_Video_Format); < Visual Basic > Dim Result As Long, channel As Long, Quality As Long, Bitrate As Long, frame_rate As Long, Angelo_Video_Format As Long channel = 0 Quality =0 Bitrate = 480000 frame_rate = 15 Angelo_Video_Format = 2 Result = A
AngeloMPEG4_Decode_ Save_File_Start– AngeloMPEG4_Decode_ Save_File_Stop– @ Syntax C/C++ (Windows 98/NT/2000/XP/CE.
format: 1: m4v, 2: avi. 3: both.
interval_second, format: Longint; Result: Longint; begin channel := 0; n_file_name := ‘Video0’; interval_second := 10; format := 3; // Save both format Result := AngeloMPEG4_Decode_Save_File_Start(channel, n_file_name, interval_second, format); end; AngeloMPEG4_Decode_File– AngeloMPEG4_Decode_File_Start– AngeloMPEG4_Decode_File_Set_Position– AngeloMPEG4_Decode_File_Pause– AngeloMPEG4_Decode_File_Continue– AngeloMPEG4_Decode_File_Get_Position– AngeloMPEG4_AVI_2_M4V– AngeloMPEG4_M4V_2_AVI– @ Syntax C/C++ (Wi
int AngeloMPEG4_Decode_File_Start(int Decoder_Index,int Mode); int AngeloMPEG4_Decode_File_Set_Position(int Decoder_Index, long* Frame_Index); int AngeloMPEG4_Decode_File_Pause(int Decoder_Index); int AngeloMPEG4_Decode_File_Continue(int Decoder_Index); int AngeloMPEG4_Decode_File_Get_Position(int Decoder_Index, long* Cur_Frame_Index); int AngeloMPEG4_AVI_2_M4V(char* file_name,unsigned long* iWidth,unsigned long* iHeight,unsigned long* Byte_Per_Pixel,unsigned long* Total_Frame,unsigned long* Time_Seconds);
Byte_Per_Pixel As Long, Total_Frame As Long, Time_Seconds As Long) As Long AngeloMPEG4_M4V _2_ AVI (ByVal file_name As String, iWidth As Long, iHeight As Long, Byte_Per_Pixel As Long, Total_Frame As Long, Time_Seconds As Long) As Long Delphi (Windows 98/NT/2000/XP) AngeloMPEG4_Decode_File(Decoder_Index:Longint; file_name:String; var iWidth:Longint; var iHeight:Longint; var Byte_Per_Pixel:Longint; var Total_Frame:Longint; var Time_Seconds:Longint):Longint; AngeloMPEG4_Decode_File_Start(Decoder_Index:Long in
file_name: The name of file to save to, includes the path and extension of file name. iWidth: Indicate the width of the MPEG4 image size. iHeight: Indicates the height of the MPEG4 image size. Byte_Per_Pixel: Number of Bytes per Pixel Total_Frame: Number of frames in the MPEG4 file. Time_Seconds: The total time of the MPEG4 file in seconds.
char* m4v_filename = “test2.m4v”; char* avi_filename = “test3.
m_filename = “test1.m4v” m4v_filename = “test2.m4v” avi_filename = “test3.
Function Library 107
< Delphi > procedure DecoderCallbackProc(Decoder_Index:Longint;i nt_status:Longint;VideoBufferaddress:Longin t); stdcall var Str_Addr : Pointer; Bitrate, Framerate, colorspace,videoformat : Longint; begin … … end; … … var m_filename, m4v_filename, avi_filename: String; Result, m_Decoder_Channel, Width, Height, Byte_Pixel, m_total_frame, m_Time_Seconds, m_pos, Mode: Longint; begin m_Decoder_Channel:= 0; Mode := 0; //play once m_filenam := ‘test1.m4v’; m4v_filename:= ‘test2.m4v’; avi_filename := ‘test3.
Result := AngeloMPEG4_Decode_File_Set_Position(m_Deco der_Channel,m_total_frame div 2); Result := AngeloMPEG4_Decode_File_Pause(m_Decoder_Cha nnel); Result := AngeloMPEG4_Decode_File_Continue(m_Decoder_ Channel); Result := AngeloMPEG4_Decode_File_Get_Position(m_Deco der_Channel,m_pos); Result := AngeloMPEG4_Decode_Stop(m_Decoder_Channel); Result:=AngeloMPEG4_Decode_M4V_2_AVI(m4v_filenam e,Width,Height,Byte_Pixel,m_total_frame,m_T ime_Seconds); Result:=AngeloMPEG4_Decode_AVI_2_M4V(avi_filenam e,Width,Height,
5.4 System Functions @ Name AngeloMPEG4_Get_Version(lMpeg4_DLLVersion, AngeloRTV_DLLVersion, Reserved) @ Description AngeloMPEG4_Get_Version: Use this function to get the software information. AngeloMPEG4_Get_Version – @ Syntax C/C++ (Windows 98/NT/2000/XP/CE.
@ Argument Mpeg4_DLLVersion: Indicates the current version of the MPEG4 DLL. It is of 4 rows in length. AngeloRTV_DLLVersion: Indicates the current version of AngeloRTV DLL. It is of 4 rows in length. @ Return Code 0: ERROR_NoError @ Example < VC/BCB > int Result; long Mp4Version[4] = {0}, DLLVersion[4] = {0}, VersionReserved[4] = {0}; CString str1, str2; Result = AngeloMPEG4_Get_Version(Mp4Version, DLLVersion, VersionReserved); str1.Format("%d.%d.%d.
Result: Longint; Str_AngeloMPEG4_Version, Str_AngeloRTV_Version: String; begin Result := AngeloMPEG4_Get_Version(Mpeg4_DLLVersion[0] , AngeloRTV_DLLVersion[0], Reserved[0]); Str_AngeloMPEG4_Version := IntToStr(Mpeg4_DLLVersion[0]); Str_AngeloMPEG4_Version := Str_AngeloMPEG4_Version + “.” + IntToStr(Mpeg4_DLLVersion[1]); Str_AngeloMPEG4_Version := Str_AngeloMPEG4_Version + “.” + IntToStr(Mpeg4_DLLVersion[2]); Str_AngeloMPEG4_Version := Str_AngeloMPEG4_Version + “.
Appendix Appendix A: Glossary Brightness: Attribute of a visual sensation according to which an area appears to exhibit more or less light CCIR: Committee Consulat International Radiotelegraphique. This is a standards committee of the International Telecommunications Union, which made the technical recommendation for European 625 line standard for video signals.
Frame: One frame (two fields) of video contains the full vertical interlaced information content of the picture. For NTSC this consists of 525 lines and PAL a frame is consisted of 625 lines. Gamma: Cathode ray tubes (CRTs) do not have a linear relationship between brightness and the input voltage applied. To compensate for this non-linearity, a pre distortion or gamma correction is applied, generally at the camera source. A value of gamma equal to 2.2 is typical, but can vary for different CRT phosphors.
Ireland) and PAL M (hybrid standard, having the same resolution as NTSC, but uses PAL transmission and color coding technology). Saturation: A characteristic describing color amplitude or intensity. A color of a given hue may consist of low or high saturation value, which relates to the vividness of color. AGC Abbreviation for automatic gain control. On a TV or VCR, AGC is a circuit that automatically adjusts the incoming signal to the proper levels for display or recording.
Appendix B: Standard Compliance Notice for USA Compliance Information Statement (Declaration of Conformity Procedure) DoC FCC Part 15 This equipment has been tested and found to comply with the limits for a Class A digital device, pursuant to Part 15 of the FCC Rules. These limits are designed to provide reasonable protection against harmful interference in a residential installation or when the equipment is operated in a commercial environment.
Notice for Europe This product is in conformity with the Council Directive 89/336/EEC amended by 92/31/EEC and 93/ 68/EEC This equipment has been tested and found to comply with EN55022/CISPR22 and EN55024/CISPR24. To meet EC requirements, shielded cables must be used to connect a peripheral to the card. This product has been tested in a typical class B compliant host system. It is assumed that this product will also achieve compliance in any class A compliant unit.
118 Appendix
Warranty Policy Thank you for choosing ADLINK. To understand your rights and enjoy all the after-sales services we offer, please read the following carefully. 1. Before using ADLINK’s products please read the user manual and follow the instructions exactly. When sending in damaged products for repair, please attach an RMA application form which can be downloaded from: http:// rma.adlinktech.com/policy/. 2.
3. Our repair service is not covered by ADLINK's two-year guarantee in the following situations: X Damage caused by not following instructions in the user's manual. X Damage caused by carelessness on the user's part during product transportation. X Damage caused by fire, earthquakes, floods, lightening, pollution, other acts of God, and/or incorrect usage of voltage transformers. X Damage caused by unsuitable storage environments (i.e. high temperatures, high humidity, or volatile chemicals).