ADLINK Technology PCI-MPG24 Manual

4-ch mpeg4 hardware video compression card network streaming manual

Advertisement

Quick Links

Manual Rev.
Revision Date:
Part No:
Advance Technologies; Automate the World.
PCI-MPG24
4-CH MPEG4 Hardware
Video Compression Card
Network Streaming Manual
2.00
January 24, 2008
50-15062-1000

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the PCI-MPG24 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for ADLINK Technology PCI-MPG24

  • Page 1 PCI-MPG24 4-CH MPEG4 Hardware Video Compression Card Network Streaming Manual Manual Rev. 2.00 Revision Date: January 24, 2008 Part No: 50-15062-1000 Advance Technologies; Automate the World.
  • Page 2 Copyright 2008 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.
  • Page 3 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,...
  • Page 5: Table Of Contents

    Table of Contents 1 Introduction ................ 1 2 Installation Guide ............... 3 Software Requirements ............3 Software Driver Installation..........3 Setup Build Environment ............. 4 3 DirectShow Programming ..........5 Descriptions of DirectShow Filters........5 Media Types ..............7 Example Graphs ..............8 Controlling Filters...............
  • Page 6 Mpg24Net_ClientSetTVStandard ......... 39 Mpg24Net_ClientSetResolution ........40 Mpg24Net_ClientSetFrameRate ........41 Mpg24Net_ClientSetPreviewDisplay ......42 Mpg24Net_ClientGetConnectionStatus ......44 Mpg24Net_ClientStartPreview ........45 Mpg24Net_ClientStartSave .......... 46 Mpg24Net_ClientStop ........... 47 Mpg24Net_ClientPreviewShow ........48 Error Codes................ 49 Table of Contents...
  • Page 7 List of Tables Table 2-1: Include Files ............. 4 Table 2-2: Library File ..............4 List of Tables...
  • Page 8 List of Tables...
  • Page 9: Introduction

    Introduction This manual is used for PCI-MPG24 networking. With this capabil- ity, users can send camera images out of local computers and receive them on remote computers. Two kinds of DirectShow filters are provided: unicast (TCP) and multicast (UDP). Unicast is used for point to point communication and multicast is used for group broadcast communication.
  • Page 10 Introduction...
  • Page 11: Installation Guide

    Open a Windows Command Prompt window and enter the fol- lowing commands: C> regsvr32 dsnet.ax C> regsvr32 dsnet_mcast.ax 3. Copy shared library: Copy Mpg24Net.dll to %windir%/system32. Note: All files listed above are located on PCI-MPG24 installa- tion directory. Installation Guide...
  • Page 12: Setup Build Environment

    Library File Description Exports API function definitions. Required for all C/C++ applica- Mpg24Net.lib tions which use PCI-MPG24 API. Table 2-2: Library File Note: All of files listed above are located on PCI-MPG24 instal- lation directory Installation Guide...
  • Page 13: Directshow Programming

    DirectShow Programming 3.1 Descriptions of DirectShow Filters ADLink Unicast Sender Filter Name ADLink Unicast Sender Filter CLSID {CB763BCE-9540-48fa-9974-69A625D478E3} MEDIATYPE_Video Supported Media Types Subtypes: DIVX_MPEG4, MICROSOFT_MPEG4, MPEG2, MJPG ADLink Unicast Receiver Filter Name ADLink Unicast Receiver Filter CLSID {15089F31-ACEF-45fe-B497-A2E5D90A69D7} MEDIATYPE_Video Supported Media Types Subtypes: DIVX_MPEG4, MICROSOFT_MPEG4, MPEG2, MJPG...
  • Page 14 ADLink Multicast Receiver Filter Name ADLink Multicast Receiver Filter CLSID {319F0815-ACEF-45fe-B497-A2E5D90A69D7} MEDIATYPE_Video Supported Media Types Subtypes: DIVX_MPEG4, MICROSOFT_MPEG4, MPEG2, MJPG DirectShow Programming...
  • Page 15: Media Types

    3.1.1 Media Types DIVX_MPEG4 Major Type MEDIATYPE_Video ‘D’, ’X’, ’5’, ’0’, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, SubType 0x00, 0x38, 0x9b, 0x71 Format Type FORMAT_Videoinfo MICROSOFT_MPEG4 Major Type MEDIATYPE_Video ‘M’, ’P’, ’4’, ’S’, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, SubType 0x00, 0x38, 0x9b, 0x71 Format Type FORMAT_Videoinfo MPEG2...
  • Page 16: Example Graphs

    3.2 Example Graphs The Microsoft DirectX SDK provides a very useful debugging utility called GraphEdit, which can be used to simulate graph building. From the Graph menu of the GraphEdit application, click Insert Filters… and choose the desired filters. Filters are organized by categories.
  • Page 17 ADLink Unicast Receiver DirectShow Programming...
  • Page 18 ADLink Multicast Sender DirectShow Programming...
  • Page 19 ADLink Multicast Receiver The graphs for sender and receiver are shown below: Unicast Sender DirectShow Programming...
  • Page 20 Unicast Receiver Preview: File Save: Multicast Sender DirectShow Programming...
  • Page 21: Controlling Filters

    Multicast Receiver Preview: File Save: 3.3 Controlling Filters The ADLink net filters expose COM interfaces as a means for applications to control video configurations. ADLink Unicast Sender & ADLink Unicast Receiver Interface IUnicastConfig CLSID {C82CB41C-D32C-4f73-9267-C114DA470378} ADLink Multicast Sender & ADLink Multicast Receiver Interface IMulticastConfig CLSID...
  • Page 22: Setnetworkinterface

    3.3.1 SetNetworkInterface The SetNetworkInterface method sets the Network Interface Card (NIC) address that the filter will use. Syntax HRESULT SetNetworkInterface( ULONG ulNIC Parameters ulNIC Specifies the NIC address, in network order (bytes ordered form left to right). You can use the inet_addr function to convert a stan- dard dotted-format string (such as “255.255.255.255) to the cor- rect binary numbers.
  • Page 23: Getnetworkinterface

    3.3.2 GetNetworkInterface The GetNetworkInterface method returns the filters’ current Net- work Interface Card (NIC) address. Syntax HRESULT GetNetworkInterface( ULONG* pNIC Parameters pNIC Pointer to a variable that retrieves the NIC address, in network order (bytes ordered form left to right). You can use the inet_addr function to convert a standard dotted-format string (such as “255.255.255.255) to the correct binary number.
  • Page 24: Setunicastgroup / Setmulticastgroup

    3.3.3 SetUnicastGroup / SetMulticastGroup The SetUnicastGroup / SetMulticastGroup methods set the group that the filter will send or listen to. Syntax HRESULT SetUnicastGroup( ULONG ulIP, USHORT usPort HRESULT SetMulticastGroup( ULONG ulIP, USHORT usPort Parameters ulIP Specifies the IP address in network order (bytes ordered from left to right).
  • Page 25: Getunicastgroup / Getmulticastgroup

    3.3.4 GetUnicastGroup / GetMulticastGroup The GetUnicastGroup / GetMulticastGroup methods retrieve the filters’ curent group address. Syntax HRESULT GetUnicastGroup( ULONG* pIP, USHORT* pPort HRESULT GetMulticastGroup( ULONG* pIP, USHORT* pPort Parameters Pointer to a variable that retrieves the IP address in network order (bytes ordered from left to right).
  • Page 26: Setsubtype

    3.3.5 SetSubType The SetSubType method set the filter’s media subtype. Syntax HRESULT SetSubType( ULONG ulSubType Paramters ulSubType Specifies the media subtype as one of the following: 0: DivX MPEG-4 (Need DivX V5.x) 1: Motion JPEG 2: Microsoft MPEG-4 (default) 3: MPEG-2 (Need third-party MPEG-2 DirectShow package, such as InterVideo, elecard, Nero …, etc.) Return values Value...
  • Page 27: Getsubtype

    3.3.6 GetSubType The GetSubType method retrieves the filter’s current media sub- type. Syntax HRESULT GetSubType( ULONG* pSubType Paramters pSubType Pointer to a variable that retrieves the media subtype as one of the following: 0: DivX MPEG-4 (Need DivX V5.x) 1: Motion JPEG 2: Microsoft MPEG-4 (default) 3: MPEG-2 (Need third-party MPEG-2 DirectShow package, such as InterVideo, elecard, Nero …, etc.)
  • Page 28: Settvstandard

    3.3.7 SetTVStandard The SetTVStandard method set the filter’s TV Standard. Syntax HRESULT SetTVStandard( ULONG ulTVStandard Paramters ulTVStandard Specifies the TV Standard as one of the following: AnalogVideo_NTSC_M, AnalogVideo_NTSC_M_J, AnalogVideo_NTSC_433, AnalogVideo_PAL_B, AnalogVideo_PAL_D, AnalogVideo_PAL_H, AnalogVideo_PAL_I, AnalogVideo_PAL_M, AnalogVideo_PAL_N, AnalogVideo_PAL_60 Return values Value Description E_INVALIDARG Invalid IP address.
  • Page 29: Gettvstandard

    3.3.8 GetTVStandard The GetTVStandard method retrieves the filter’s current TV Stan- dard. Syntax HRESULT GetTVStandard( ULONG* pTVStandard Paramters pTVStandard Pointer to a variable that retrieves the TV standard. Return values Value Description E_INVALIDARG Invalid IP address. S_OK The method succeeded. DirectShow Programming...
  • Page 30: Setframerate

    3.3.9 SetFrameRate The SetFrameRate method set the filters’ frame rate ratio. Syntax HRESULT SetFrameRate( ULONG ulFrameRate Paramters ulFrameRate Specifies the frame rate ratio. Frame rate ratio = 1001 * frame rate (fps). Fram rate ratio can be expressed as one of following values: If TV Standard = NTSC, 30000: NTSC 29.97fps( 30 fps ) 15000: NTSC 15fps( 30/2 fps )
  • Page 31 1001: PAL 1fps( 25/25 fps ) Return values Value Description E_INVALIDARG Invalid IP address. The operation could not be performed E_UNEXPECTED because the filter is not stopped. S_OK The method succeeded. DirectShow Programming...
  • Page 32: Getframerate

    3.3.10 GetFrameRate The GetFrameRate method retrieves the filter’s current frame rate ratio. Syntax HRESULT GetFrameRate( ULONG* pFrameRate Paramters pFrameRate Pointer to a variable that retrieves the frame rate ratio. Frame rate ratio = 1001* frame rate (fps). Return values Value Description E_INVALIDARG Invalid IP address.
  • Page 33: Setresolution

    3.3.11 SetResolution The SetResolution method set the filter’s resolution. Syntax HRESULT SetResolution( ULONG ulWidth, ULONG ulHeight Paramters (ulWidth, ulHeight) Specifies the width and height. It could be one of the following pairs: If TV Standard = NTSC, (720, 480), (352, 240), (640, 480), (320, 240), (480, 480),...
  • Page 34 Return values Value Description E_INVALIDARG Invalid IP address. The operation could not be performed E_UNEXPECTED because the filter is not stopped. S_OK The method succeeded. DirectShow Programming...
  • Page 35: Getresolution

    3.3.12 GetResolution The GetResolution method retrieves the filter’s current width and height. Syntax HRESULT GetResolution( ULONG* pWidth, ULONG* pHeight Paramters pWidth Pointer to a variable that retrieves the media width. pHeight Pointer to a variable that retrieves the media height. Return values Value Description...
  • Page 36 DirectShow Programming...
  • Page 37: Windows Api Functions

    The Application Program Interface (API) functions are based on DirectX 9.0. DirectX 9.0 must be installed in order for the API func- tions to work. The API library is additional software to PCI-MPG24.dll for net- work streaming extension. 4.2 Function List...
  • Page 38: Server Functions

    4.3 Server functions 4.3.1 Mpg24Net_ServerOpen This function will open a new server instance. A server instance is a network server that waits for client connections (unicast), or sends stream data to the same network group of receivers (multi- cast). Syntax int Mpg24Net_ServerOpen( int StreamType = 0 Parameters...
  • Page 39: Mpg24Net_Serverclose

    4.3.2 Mpg24Net_ServerClose This function will close a server instance. A server instance is a network server that waits for client connections (unicast), or sends stream data to the same network group of receivers (multicast). Syntax int Mpg24Net_ServerClose( int hHandle Parameters hHandle Specifies the handle of the server instance.
  • Page 40: Mpg24Net_Serverstart

    4.3.3 Mpg24Net_ServerStart This function will start a server. The server will open a network socket and wait for client connections (unicast), or send stream data over the network (multicast). If the stream type is unicast, a server instance has a maximum of 16 concurrent connections. Syntax int Mpg24Net_ServerStart( int hHandle,...
  • Page 41: Mpg24Net_Serverstop

    4.3.4 Mpg24Net_ServerStop This function can be used to stop a server. The server will close a network socket and close all client connections. Syntax int Mpg24Net_ServerStop( int hHandle Parameters hHandle Specifies the handle of the server instance. Return Values See chapter 4.5. Windows API Functions...
  • Page 42: Mpg24Net_Serversend

    4.3.5 Mpg24Net_ServerSend This function can be used to send stream data to all clients. The stream data comes from external library (callback function of PCI_MPG24.dll). Syntax int Mpg24Net_ServerSend( int hHandle, BYTE * pBuffer, int iBufferSize, int iSyncPoint Parameters hHandle Specifies the handle of the server instance. pBuffer Specifies the buffer pointer of stream data.
  • Page 43 void __stdcall MyCallbackProc( BYTE * pBuffer, int iBufferSize, int iSyncPoint if(iBufferSize>0 && pBuffer) Mpg24Net_ServerSend( hHandle, pBuffer, iBufferSize, iSyncPoint start() // Open ADLink Hardware MPEG4 Device Mpg24_EncoderOpen(0, 0); // Set configuration: NTSC Full D1 30fps 4Mbps Microsoft MPEG-4 Mpg24_EncoderSetVideoFormat(0, 0, VideoFormat_Standard, 0); Mpg24_EncoderSetVideoFormat(0, 0, VideoFormat_Size, 0);...
  • Page 44: Client Functions

    4.4 Client functions 4.4.1 Mpg24Net_ClientOpen This function will open a new client instance. A client instance is a network client that connects to a server (unicast), or joins a net- work group (multicast). Syntax int Mpg24Net_ClientOpen( int StreamType = 0 Parameters StreamType Specifies the type of the network streaming.
  • Page 45: Mpg24Net_Clientclose

    4.4.2 Mpg24Net_ClientClose This function will close the client instance. A client instance is a network client that connects to a server (unicast), or joins a net- work group (multicast). Syntax int Mpg24Net_ClientClose ( int hHandle Parameters hHandle Specifies the handle of the client instance. Return Values Handle of client instance if return value is greater than or equal to 0.
  • Page 46: Mpg24Net_Clientsetsubtype

    4.4.3 Mpg24Net_ClientSetSubType Specifies the video subtype. Syntax int Mpg24Net_ClientSetSubType ( int hHandle, int iSubType Parameters hHandle Specifies the handle of the client instance. iSubType Specifies the video subtype. It could be: 0: DivX MPEG-4(need DivX V5.x) 1: Motion JPEG 2: Microsoft MPEG-4 (default) 3: MPEG-2 (Need third-party MPEG-2 DirectShow software, such as InterVideo, Elecard, Nero…,etc.) Return Values...
  • Page 47: Mpg24Net_Clientsettvstandard

    4.4.4 Mpg24Net_ClientSetTVStandard Specifies the TV standard. Syntax int Mpg24Net_ClientSetTVStandard ( int hHandle, int iTVStandard Parameters hHandle Specifies the handle of the client instance. iTVStandard Specifies the TV standard. It could be: 0: NTSC 1: PAL Return Values See chapter 4.5. Windows API Functions...
  • Page 48: Mpg24Net_Clientsetresolution

    4.4.5 Mpg24Net_ClientSetResolution This function will specifies the specific resolution (width and height of video). Syntax int Mpg24Net_ClientSetResolution ( int hHandle, int iResolution Parameters hHandle Specifies the handle of the client instance. iResolution Specifies the specific resolution. It depends on the value of the TV standard.
  • Page 49: Mpg24Net_Clientsetframerate

    4.4.6 Mpg24Net_ClientSetFrameRate Specifies the specific frame rate. Syntax int Mpg24Net_ClientSetFrameRate ( int hHandle, int iFrameRate Parameters hHandle Specifies the handle of the client instance. iResolution Specifies the specific frame rate which is dependant upon the value of the TV standard. It could be: TV Standard = NTSC 0: 29.97 fps 1: 15 fps...
  • Page 50: Mpg24Net_Clientsetpreviewdisplay

    4.4.7 Mpg24Net_ClientSetPreviewDisplay Specifies the configuration of preview window. Syntax int Mpg24Net_ClientSetPreviewDisplay ( int hHandle, int hWnd, int Left, int Top, int Width, int Height, int AutoShow Parameters hHandle Specifies the handle of the client instance. hWnd Specifies the handle of a parent window for the video window. The video images will overlay on this window.
  • Page 51 Return Values See chapter 4.5. Windows API Functions...
  • Page 52: Mpg24Net_Clientgetconnectionstatus

    4.4.8 Mpg24Net_ClientGetConnectionStatus This function can be used to retrieve the connection status either to the server (unicast), or a network group multicast). Syntax int Mpg24Net_ClientGetConnectionStatus( int hHandle Parameters hHandle Specifies the handle of the client instance. Return Values 0: Disconnected 1: Connected Others: Error occurs.
  • Page 53: Mpg24Net_Clientstartpreview

    4.4.9 Mpg24Net_ClientStartPreview This function will start a client preview of a video graph. The client will open a network socket and establish a connection with the server (unicast), or it will join a network (multicast). Syntax int Mpg24Net_ClientStartPreview( int hHandle, char *ServerIp, short port Parameters...
  • Page 54: Mpg24Net_Clientstartsave

    4.4.10 Mpg24Net_ClientStartSave This function can be used to start a client. The client will open a network socket and establish a connection with the server (uni- cast), or join a network (multicast). This function also receives the stream data and saves them to a media file. Syntax int Mpg24Net_ClientStartSave( int hHandle,...
  • Page 55: Mpg24Net_Clientstop

    4.4.11 Mpg24Net_ClientStop Stop a client. The client will close a network socket and terminate the server connection (unicast) or leave the network (multicast). Syntax int Mpg24Net_ClientStop( int hHandle Parameters hHandle Specifies the handle of the client instance. Return Values See chapter 4.5. Windows API Functions...
  • Page 56: Mpg24Net_Clientpreviewshow

    4.4.12 Mpg24Net_ClientPreviewShow This function can be used to show or hide the preview graph. Syntax int Mpg24Net_ClientPreviewShow( int hHandle, short Visible Parameters hHandle Specifies the handle of the client instance. Visible Specifies whether the preview graph is shown. It could be: 0: Invisible 1: Visible Return Values...
  • Page 57: Error Codes

    4.5 Error Codes Mpg24Net_GetLastErrorInfo Use this function to get an error message of last error. Syntax Int Mpg24Net_GetLastErrorInfo( TCHAR *ErrorInfo Parameters ErrorInfo Specifies the pointer of a text buffer for storing the error message. Users need to allocate a buffer space enough to get this error message (max.
  • Page 58 Error Name Value Description An error message comes Mpg24Net_DIRECTX_ERROR form DirectX Input parameters exceed Mpg24Net_INVALID_PARAMETER allowable range Invalid operation while run- Mpg24Net_NOT_STOPPED ning Windows API Functions...
  • Page 59: Warranty Policy

    Warranty Policy Thank you for choosing ADLINK. To understand your rights and enjoy all the after-sales services we offer, please read the follow- ing carefully. 1. Before using ADLINK’s products please read the user man- ual and follow the instructions exactly. When sending in damaged products for repair, please attach an RMA appli- cation form which can be downloaded from: http:// rma.adlinktech.com/policy/.
  • Page 60 3. Our repair service is not covered by ADLINK's guarantee in the following situations: Damage caused by not following instructions in the User's Manual. Damage caused by carelessness on the user's part dur- ing product transportation. Damage caused by fire, earthquakes, floods, lightening, pollution, other acts of God, and/or incorrect usage of voltage transformers.

Table of Contents