Welcome to LEAD Support Forum Login | Register | Faq  

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

Take Frame from avi without show any frame
Started by ShodawN at 07-23-2008 11:33. Topic has 7 replies.

Print Search « Previous Thread Next Thread »
  07-23-2008, 11:33
ShodawN is not online. Last active: 7/16/2008 11:50:47 AM ShodawN

Top 500 Posts
Joined on 07-15-2008
Posts 11
Take Frame from avi without show any frame
Reply Quote
Hello,

Can i take a frame from avi file without show any frame? Using VB.Net 2005 and Multimedia SDK v15?

Thank you

   Report 
  07-23-2008, 11:47
jigar is not online. Last active: 12/12/2008 5:08:42 PM jigar



Top 10 Posts
Joined on 08-22-2007
Posts 480
Re: Take Frame from avi without show any frame
Reply Quote
You have to hide the play control if it is visible.  Then you just call SaveStillBitmap() or GetStillDIB() and it will get the frame it is currently at.  To get a frame from any video file, it has to be loaded in a control.

LEADTOOLS Technical Support
   Report 
  07-23-2008, 13:59
ShodawN is not online. Last active: 7/16/2008 11:50:47 AM ShodawN

Top 500 Posts
Joined on 07-15-2008
Posts 11
Re: Take Frame from avi without show any frame
Reply Quote
If i use SaveStillBitmap when i'm playing a video i have an exception.

   Report 
  07-23-2008, 16:54
jigar is not online. Last active: 12/12/2008 5:08:42 PM jigar



Top 10 Posts
Joined on 08-22-2007
Posts 480
Re: Take Frame from avi without show any frame
Reply Quote
What exception do you get?

LEADTOOLS Technical Support
   Report 
  07-28-2008, 6:38
ShodawN is not online. Last active: 7/16/2008 11:50:47 AM ShodawN

Top 500 Posts
Joined on 07-15-2008
Posts 11
Re: Take Frame from avi without show any frame
Reply Quote
Hello,

I get a InvalidActiveXStateException.

If i set AxltmmPlayCtrl.Visible= false, i get an InvalidActiveXStateException.
If i set AxltmmPlayCtrl.Visible= true, i get a timeout from GetStillPicture method.

My code is:
-----------------------------------------
        Dim img As Image = Nothing
        Dim r As New AxltmmPlayCtrl()
        r.Location = New Point(10, 10)
        r.Width = 10
        r.Height = 10
        r.Visible = False
        Me.Controls.Add(r)

        Try
            r.sourcefile = filename
            img = r.GetStillPicture(500)
        Catch
        End Try

        r.Stop()
        r.Dispose()
        r = Nothing
        GC.Collect()
-----------------------------------------

Thank you

   Report 
  07-29-2008, 18:01
jigar is not online. Last active: 12/12/2008 5:08:42 PM jigar



Top 10 Posts
Joined on 08-22-2007
Posts 480
Re: Take Frame from avi without show any frame
Reply Quote
I'm going to test this out and report back to you tomorrow.  I think there is another post you created that is related to this.  I'll answer that too.

LEADTOOLS Technical Support
   Report 
  07-30-2008, 17:49
jigar is not online. Last active: 12/12/2008 5:08:42 PM jigar



Top 10 Posts
Joined on 08-22-2007
Posts 480
Re: Take Frame from avi without show any frame
Reply Quote
I tried it out with your code and got the same error.  But when I drag and drop the AxltmmPlayCtrl on to the form then it works when I call GetStillDIB/Picture.  The Visible property has no affect on that method call.  I think you are doing the same thing the ltmmCaptureCtrl in your other thread.  As a work around you can add the play control through the WinForms designer and set the Visible property to false.  I will check this with our engineers and find out if it is a bug.

LEADTOOLS Technical Support
   Report 
  08-04-2008, 10:21
jigar is not online. Last active: 12/12/2008 5:08:42 PM jigar



Top 10 Posts
Joined on 08-22-2007
Posts 480
Re: Take Frame from avi without show any frame
Reply Quote
So after some testing/trial & error, I figured out you have to do this.

            AxLTMMLib.AxltmmPlayCtrl player = new AxLTMMLib.AxltmmPlayCtrl();
            ((System.ComponentModel.ISupportInitialize)(player)).BeginInit();
            this.Controls.Add(this.player);
            ((System.ComponentModel.ISupportInitialize)(player)).EndInit();

What it is doing is creating a new play control.  Then type casting it to ISupportInitialize and calling the BeginInit() of that object.  Then it adds the player to the form, and type casts it to call EndInit().  I know you are programming in VB.NET so I explained the code a little.  After you do that you just set the Visible property to false.  Set the sourcefile property.  Then you can call GetStillDIB().  You don't have to set the Size or Location property of the player control.  Let me know how it goes for you.
LEADTOOLS Technical Support
   Report 
Post
LEAD Support Fo... » Developer » Multimedia » Take Frame from avi without show any frame

Powered by Community Server, by Telligent Systems