Giter Club home page Giter Club logo

ipcamconnect's Introduction

CONTENT

1. About codes
2. License
3. Output
4. Fabric functions
5. DLLs for run
6. Usage for MJPEG
7. Usage for H264
8. Contact

---------------------
Codes.

Handling streams of IP cameras:

1. MJPEG by HTTP
2. H264 by RTSP
CodeBlocks project with using FFMPEG and OpenCV libraries

------------------------------------------
License

This code is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2.1 of the License, or (at your
option) any later version. (See <http://www.gnu.org/copyleft/lesser.html>.)

This code is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for
more details.

You should have received a copy of the GNU Lesser General Public License
along with this code; if not, contact to me via http://www.kvy.com.ua 

-------
Output:
in
\IPCamera\IPCamConnect\bin\Debug-Win32
\IPCamera\IPCamConnect\bin\Release-Win32

1. IPCamConnect.dll
2. IPCamConnect.lib - .lib for MSVC projects 
3. CIPCamConnect.h  - a header file for projects
------------------------

Export fabric functions:

1. ICIPCamConnect* WINAPI CreateIPCamConnectClass(const LPCSTR strURL);

- create the object of CIPCamConnect for H264 by RTSP

2. ICIPCameraMJPEGHTTP* WINAPI CreateICIPCameraMJPEGHTTP(const LPCSTR strURL);

- create the object of CIPCameraMJPEGHTTP for MJPEG by HTTP
-------------------------------------

DLLs from ffmpeg:

\IPCamera\IPCamConnect\ffmpeg_dll

------------------------------------
Usage for MJPEG

1. Add to the project 

#include "CIPCamConnect.h"

#pragma comment( lib, "IPCamConnect")

2. Create the object:

ICIPCameraMJPEGHTTP* pMJPEG = CreateICIPCameraMJPEGHTTP("http://......"); 

3.

Add later.......

-----------------------------------------------
Usage for H264

!!!!!!Attention!!!!!!!!! 
FFMPEG digest authentication worked incorrect for RTSP. I tested it on the last 07.2014 versions of FFMPEG.
I found a solution of that problem, but have not time to move the new codes to GitHub. Please contact to me
for details.   
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

#include "CIPCamConnect.h"

#pragma comment( lib, "IPCamConnect")



int _tmain(int argc, _TCHAR* argv[])
{
	ICIPCamConnect* pP = NULL;
	pP =  CreateIPCamConnectClass("rtsp://user:[email protected]/0");

	wchar_t strErr[MAX_PATH] = {0};
	bool bErr =  pP->CheckErr(strErr);
	
	if (!bErr)
	{
		PBYTE pBuf = NULL;
		int iSize  = 0;
		int x, y;
		int n = 50, i = 0; //timer 5 sec
		//wait for the first frame
		while ((iSize = pP->GetSize(x, y)) == 0)
		{
			Sleep(100);
			i++;
			if (i == n)
				break;
		}
		if (iSize != 0)
		{//receive only one frame
			printf("ok\n");
			pP->Lock();
			iSize = pP->GetSize(x, y);
			pBuf = new unsigned char [iSize];
			pP->GetBuffer(pBuf); //get data in BGR24
			pP->Unlock();
			
			//......
			//do something with data here 
			//......
			
			delete [] pBuf;
		}
		else
			printf("Error\n");
	}
	else
		printf("Error: %s", strErr);

	if (pP)
		pP->Release();
	return 0;
}

-------------------------------------------------------------------------
Contact


Victor Kulichkin
http://www.kvy.com.ua

ipcamconnect's People

Contributors

vkulichkin avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.