LEADTOOLS Support
General
General Questions
[Simple question] capturing still images from a file
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Saturday, March 26, 2011 1:09:10 AM(UTC)
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
#2
Posted
:
Sunday, March 27, 2011 5:07:17 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
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)
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)
Groups: Registered, Tech Support
Posts: 1,326
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
LEADTOOLS Support
General
General Questions
[Simple question] capturing still images from a file
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.