Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

Re: Motion Detection Filter in DOTNET C#
Started by Otis at 09-30-2005 14:05. Topic has 8 replies.

Print Search « Previous Thread Next Thread »
  09-30-2005, 14:05
Otis is not online. Last active: 12/30/2008 8:52:10 PM Otis



Top 10 Posts
Joined on 10-19-2004
Charlotte, NC
Posts 309
Motion Detection Filter in DOTNET C#

Attachment: DOTNET Motion Detection.zip
Reply Quote
The attached C# application uses our Multimedia COM object and our Motion Detection Filter. V14.5
Otis Goodwin
LEAD Developer Support
   Report 
  07-15-2006, 4:01
dillwaly is not online. Last active: 7/15/2006 8:00:45 AM dillwaly

Not Ranked
Joined on 07-15-2006
Posts 3
Re: Motion Detection Filter in DOTNET C#
Reply Quote
hi
LTMMLib, LMVMtnDetLib and AxLTMMLib libraries have not included  in attached  component.
please attached them.
thanx

   Report 
  07-17-2006, 10:09
Otis is not online. Last active: 12/30/2008 8:52:10 PM Otis



Top 10 Posts
Joined on 10-19-2004
Charlotte, NC
Posts 309
Re: Motion Detection Filter in DOTNET C#

Attachment: DOTNET Motion Detection.zip
Reply Quote
I have attached a project that has been modified to use the V15 SDK. If you have the Multimedia V15 SDK installed, this project should compile with no changes.
Otis Goodwin
LEAD Developer Support
   Report 
  01-10-2007, 9:21
serkanp is not online. Last active: 1/10/2007 1:15:36 PM serkanp

Not Ranked
Joined on 01-10-2007
Posts 1
Re: Motion Detection Filter in DOTNET C#
Reply Quote
is there any vb.net 2005 sample ?
also c# version not working on eval 15
   Report 
  01-11-2007, 9:22
Otis is not online. Last active: 12/30/2008 8:52:10 PM Otis



Top 10 Posts
Joined on 10-19-2004
Charlotte, NC
Posts 309
Re: Motion Detection Filter in DOTNET C#
Reply Quote

Unfortunately we do not currently have a VB.NET version. There are numerous tools on the NET such as "InstantVB" which customers have used in the past to convert snippets or projects. The evaluation COM object and release COM object have different class ID's so you may need to remove and re-add the LTMM references to compile.


Otis Goodwin
LEAD Developer Support
   Report 
  06-01-2007, 5:22
motyka is not online. Last active: 6/1/2007 10:09:30 AM motyka

Not Ranked
Joined on 06-01-2007
Posts 5
Re: Motion Detection Filter in DOTNET C#
Reply Quote
Hello,
I've got a problem with motin detection filter in C# (Visual Studio 2005)

Filter graph hangs on callback. When I don't use callback, the filter wokrs fine, (the motion detection areas are visible on video). But when I try to use callback - the graph hangs.
My code:

ILMVMtnDet motionDetFilter = new LMVMtnDetClass(); // filter declaration

.. then after I add filter to graph and connects with other filters I do some configuration:

        private void ConfigureMotionDetection(ILMVMtnDet motionDetection)
        {
            m_MotionDetectionCallback = new MotionDetectionCallback();

            motionDetection.AutoStart = true;
            motionDetection.CallbackObj = new MotionDetectionCallback();
        }
The callback class:
    public class MotionDetectionCallback : ILMVMtnDetUserCallback
    {
        public MotionDetectionCallback()
        {
        }
        ~MotionDetectionCallback()
        {
        }
       public int CallbackProc(int lEvent, int pFrame, int lWidth, int lHeight, int lBitCount, int lFrameSize, bool bTopDown)
        {
            System.Diagnostics.Debug.WriteLine(lEvent);
            return 0;
        }
    }


Any ideas, pliz?

Regards,
Roman.

   Report 
  06-04-2007, 9:45
Otis is not online. Last active: 12/30/2008 8:52:10 PM Otis



Top 10 Posts
Joined on 10-19-2004
Charlotte, NC
Posts 309
Re: Motion Detection Filter in DOTNET C#
Reply Quote
Your code looks correct so I will need more information to resolve this issue. Please send a small sample project (not your entire project), and I will debug your project here.
Otis Goodwin
LEAD Developer Support
   Report 
  06-05-2007, 6:14
motyka is not online. Last active: 6/1/2007 10:09:30 AM motyka

Not Ranked
Joined on 06-01-2007
Posts 5
Re: Motion Detection Filter in DOTNET C#

Attachment: MotionDetectionLead.zip
Reply Quote
Hello,
I based my sample on GSSF sample from DirectShowNet, as I use it indeed.
But during building that sample I've probably found the reason of such behavior.
If you compile that project with USEWINFORM directive, which starts Winform, the callback will be ok, but if you don't use that directive (pure console application) the callback hangs:

        static void Main()
        {
#if USEWINFORM
            Application.Run(new Form1()); // then start button - it is ok
#else
            Console.WriteLine("Press eneter to start it");
            Console.ReadLine();
            m_play = new DxPlay();
            m_play.Start();
            Console.WriteLine("Press eneter to stop it");
            Console.ReadLine();
            m_play.Stop();
#endif
        }


It may have it's origin in 'test/warning' which fires motion detection filter, and it might hangs when no windows message loop is present (or sth. like that).
I believe that filter without that warning window wouldn't hangs on callback, could you confirm that?

Regards,
Roman.

   Report 
  06-07-2007, 9:23
Otis is not online. Last active: 12/30/2008 8:52:10 PM Otis



Top 10 Posts
Joined on 10-19-2004
Charlotte, NC
Posts 309
Re: Motion Detection Filter in DOTNET C#
Reply Quote
You need a message pump to process the messages. If you are using a console application, you can probably add System.Windows.Forms and use DoEvents to process the messages.
Otis Goodwin
LEAD Developer Support
   Report 
Post
LEAD Support Fo... » Developer » Multimedia » Re: Motion Detection Filter in DOTNET C#

Powered by Community Server, by Telligent Systems