Can I use OpenCV to edit video captured from Ip camera with Dahua SDK? Here are the portion of Dahua sample code:
// initialized play list
BOOL bOpenRet = PLAY_OpenStream(g_lRealPort, 0, 0, 1024 * 500);
if (bOpenRet)
{
// start play
BOOL bPlayRet = PLAY_Play(g_lRealPort, hMainWnd);
if (bPlayRet)
{
// monitor preview
long lRealHandle = CLIENT_RealPlayEx(lLoginHandle, nChannelID, 0);
if (0 != lRealHandle)
{
// set recall function handling data
CLIENT_SetRealDataCallBackEx(lRealHandle, RealDataCallBackEx, (DWORD)0, 0x1f);
}
else
{
//printf("Fail to play!\n");
PLAY_Stop(g_lRealPort);
PLAY_CloseStream(g_lRealPort);
}
}
else
{
PLAY_CloseStream(g_lRealPort);
}
}
The code above is connecting to cam using TCP and the streaming the video, the call back function RealDataCallBackEx is called for streaming, I can display the video on a Window, but how can I let OpenCV library to deal with it?
Here are the code of the RealDataCallBackEx
function:
void __stdcall RealDataCallBackEx(LONG lRealHandle, DWORD dwDataType, BYTE *pBuffer, DWORD dwBufSize, LONG lParam, DWORD dwUser)
{
BOOL bInput = FALSE;
bInput = PLAY_InputData(g_lRealPort, pBuffer, dwBufSize);
}