Video recording on motion detection
-
i have used following four functions for motion detection part only: 1)AdjustMotionDetectPrecision() 2)SetupMotionDetection() 3)StartMotionDetection() 4)MotionAnalyzer() using these four functions,motion detected has started. but i dnt knw how to start recording???? i m sending u some code : here it is:::: if(frameType > 0) { if(frameType == PktSysHeader) { memcpy(FileHeader[channelNum], DataBuf, Length); FileHeaderLen = Length; } if(frameType == PktIFrames || frameType ==PktSubIFrames) { status = 1; } else { status = 0; } if(frameType == PktMotionDetection) { int result[4]; if(bOverlayMode) { hkdlg->m_VideoWin.DrawVectEx(channelNum, (char *)DataBuf); } else { hkdlg->m_bMoving[channelNum] = TRUE; memcpy(motionData[channelNum],(char*)DataBuf,Length); } MotionAnalyzer(ChannelHandle[channelNum],(char*)DataBuf,15,result); if((result[0] + result[1] + result[2] + result[3])) { if (channelNum ==0) TRACE("!!!!!!!CH=%d motion detect result is %d %d %d %d\n",channelNum,result[0],\ result[1],result[2],result[3]); //The function Trigger() do the following operation: write the video&audio data which are before the motion frame to file if(!hkdlg->baftermotion[channelNum]) alarmFile[channelNum].Trigger(gFileHandle[channelNum]); //when the motion frame returns,clear ualreadywriteframes[channelNum] and set it as 0 ,be ready for writing the video&audio data after motion hkdlg->ualreadywriteframes[channelNum]=0; hkdlg->baftermotion[channelNum]=TRUE; } return 0; } if(frameType == PktOrigImage) { return 0; } In this code should i start recording after motionanalyser() function????????????? tyagi