|
hye,
i m trying to record video on motion detection in VC++.
Can anybody tell the exact procedure i should apply
motion detection has started but i dnt know how to write code for recording the video on motion detection.....
Neha
|
|
|
|
|
There isn't a exact procedure to implementing motion detection. There are many algorithms for doing that, and searching the articles on this site anf google should bring up some results.
Good luck
|
|
|
|
|
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?????????????
Neha
|
|
|
|
|
I am searching about an object on the codeproject and sudden see Motion Detection Algorithms[^] and remembered that a OP aksed about motion detection so I repled to you.;)
|
|
|
|
|
Is there some way how to disable playing of the system sounds (stored in registry) or any sounds for some process only?
I need to turn off sounds in webbrowser hosted in my application but I don't want to turn them off for IE globally.
Thank you!
rrrado
|
|
|
|
|
|
Thank you but this will disable sounds not only for my webbrowser but also for IE
rrrado
|
|
|
|
|
WhiteSky wrote: and see http://www.codeproject.com/audio/mixerSetControlDetails.asp[^] of DavidCrow is helpfuls for you.
Which would disable all sounds. Not exactly the desired result.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Sorry for my poor English .
There is a way to resolve this issue , but I didn't try it . That is to write a monitor-program hook all playsound funtion and make it(playsound funtion) disabled for the process.
|
|
|
|
|
But how can I hook to PlaySound calls?
rrrado
|
|
|
|
|
Sorry for my poor English .
You should study the hooks .
If you search the hook as the keyword in this website, you could find something.
|
|
|
|
|
|
Hi to All?
Could Any one help me? How to get word capture from another GUI application using hooks concept in VC++?
Thanks & Regards,
Ramana AV.
|
|
|
|
|
What do you mean by word capture?
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
It seems that whenever I distribute an application, it never works on my first beta testers computer, even though they are running the same O/S (Windows XP), with the latest DirectX (April 2007).
Anyone else run into this problem? What do you do to solve it?
Patrick
|
|
|
|
|
maybe MFC dll's are not instaled on his computer?
rrrado
|
|
|
|
|
|
Stick^ wrote: it never works
Can you provide some detail?
/ravi
|
|
|
|
|
I will try, but not likely to be helpful to you.
I make add-on aircraft and avionics gauges for MS Flight Simulator.
The "gauges" are made with an SDK supplied by MS, and compile into .dll's. However, they are not tru .dll's from what I understand. In any case, the "gauges" (multiple in one file) appear fine in my aircraft on MSFS, and he just gets a blank panel.
I made a version in which I turned off the protection code to see if perhaps the call to get verify the license key is maybe the issue as he is on XP Pro, and someone else suggested that I compile with "multi-threaded" vs. multithreaded dll as some new runtimes in an update from MS on the game has new runtimes in it. So, I will try that and see what happens too.
I am just ready to pull out my hair. But, this is my own fault for not actually going to school for this and learning the proper way, haha.
My problem is I barely understand what I'm doing sometimes. C++ is no problem, but Windows is way over my head. =)
Patrick
|
|
|
|
|
Can you more explain and some detail of your program?
|
|
|
|
|
Hi,
Yes, but I think the problem may be solved now.
http://i91.photobucket.com/albums/k282/Benchmark_Avionics/Properties.png[^]
Someone informed me that a recent change in the game program included some libraries that require now that we statically link the program. So, I have recompiled and will not test this in the morning.
Thanks guys for your ideas. I'll let you know if this was the problem for everyone's future reference.
As I am using MS DirectInput and DirectSound in this project, I was worred it had to do with DirectX, but seems it has to do with the recent game update.
|
|
|
|
|
Glad you found the answer.
|
|
|
|
|
Sorry for my poor English.
Is it the issue of debug version and release version ?
|
|
|
|
|
No, we tested that, but it may be solved now. (See above).
|
|
|
|
|
Hi,
How to restrict the number of objects created for a class??
Thanks
Today is a gift, that's why it is called the present.
|
|
|
|