Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Saturday, March 26, 2011 1:09:10 AM(UTC)

cm2187  
cm2187

Groups: Registered
Posts: 3


Hello

apologies if this is a bit basic but I am new to leadtools and I am looking for a way to do this: I would like to capture still images from a file (any video format).

I understand there are 3 main classes:
CaptureCtrl, but that's not for a file as a source
PlayCtrl: but this is for on screen rendering, I just want to extract the stills, not play the video
ConvertCtrl: no onscreen rendering but this requires to convert into another format. I am not going to start a conversion if I just want to capture a few screenshots.

Would it be possible to indicate which of these (or any other) classes I should be using?

thanks in advance
Charles
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Sunday, March 27, 2011 5:07:17 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,328

Was thanked: 1 time(s) in 1 post(s)

Charles,
If you want to be able to seek (skip) to a specific location in the source video file, the best control to use is the PlayCtrl, because it allows you to specify the current position, then save a still bitmap using one of these functions:
------------
GetStillDIB
GetStillPicture
SaveStillBitmap
SaveStillDIB
------------

Please note that you can use the control without showing it by setting its visible property to False.

The code will be something as follows:
+--------+
ltmmPlayCtrl1.AutoStart = False
ltmmPlayCtrl1.Visible  = False
ltmmPlayCtrl1.sourcefile = "C:\Long.avi"
ltmmPlayCtrl1.CurrentFramePosition = 100
ltmmPlayCtrl1.SaveStillBitmap "C:\StillBitmap.bmp", ltmmPlay_StillFormat_BMP, 2, 0, -1
+--------+

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#3 Posted : Sunday, March 27, 2011 10:33:30 PM(UTC)

cm2187  
cm2187

Groups: Registered
Posts: 3


Thanks. It is working on most video formats but it looks like it fails on WMV/ASF files, and some MPEG2 files. Is there another method that could work or is it just not implemented?

thanks
Charles
 
#4 Posted : Monday, March 28, 2011 3:33:57 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,328

Was thanked: 1 time(s) in 1 post(s)

Not all media formats allow frame seeking. You should call ltmmPlayCtrl.CheckSeekingCapabilities method to determine if ltmmPlay_Seeking_FrameBackward and ltmmPlay_Seeking_FrameForward are enabled. For more information, please see the following help topics in the LEADTOOLS Multimedia help file:
- ltmmPlayCtrl.CheckSeekingCapabilities Method
- ltmmPlay_Seeking Constants

Try to use the ltmmPlayCtrl.CurrentPosition Property.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2020, Yet Another Forum.NET
This page was generated in 0.064 seconds.