Welcome to LEAD Support Forum Login | Register | Faq  

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

Simultaneous Image and Video capture
Started by Amit at 05-17-2006 7:06. Topic has 19 replies.

Print Search « Previous Thread Next Thread »
  05-17-2006, 7:06
Amit is not online. Last active: 12/17/2008 11:45:37 AM Amit

Top 25 Posts
Joined on 05-10-2006
Posts 168
Simultaneous Image and Video capture
Reply Quote

Hi,

I am using visual basic 6 with lead tools 14

I want to save single frame to file(i. e. image in jpeg format) when ltmmCaptureCtrl is capturing video and writing it to file without stopping the capture process.

Any of the methods for still image capture shown in multimedia documentation cannot be used because ltmmCaptureCtrl will be in RunCapture mode during capture, and for still image capture you have to call StartCapture mode of ltmmCaptureCtrl (ltmmCaptureCtrl.StartCapture  ltmmCapture_Mode_Still)

As soon as I capture the image (while video capturing is going on . . .) I will display the image in LEADRasterView as a snap.

This is one of the crutial demand from my customers.

Please help

Thanks


Amit
   Report 
  05-21-2006, 15:45
Amin is not online. Last active: 10/29/2008 7:59:53 AM Amin



Top 10 Posts
Joined on 06-27-2005
Posts 749
Re: Simultaneous Image and Video capture
Reply Quote
Amit,
You can directly obtain a video frame as an image in a LEAD Raster object using the Video Callback filter, without interrupting the video capture stream.
This Raster Object can be the Raster member of the LEADRasterView control, which means you only need to copy the data once, which will provide you with very good speed.

If you also want to save this still image to disk, you can do that using the Raster IO object after the image is in the Raster Object. However, keep in mind that the added disk access might have some performance effects.

The toolkit has a VB 6 demo that uses the Video Callback filter. Its source code is in the LTMM examples folders under VB\Callback


Amin Dodin
LEADTOOLS Technical Support

   Report 
  05-22-2006, 5:04
Amit is not online. Last active: 12/17/2008 11:45:37 AM Amit

Top 25 Posts
Joined on 05-10-2006
Posts 168
Re: Simultaneous Image and Video capture
Reply Quote

Thanks for reply Amin.

Sorry, but I did'nt understood what you want to say.  I tried your solution.  The callback example program you have stated in your reply is for video replay using ltmmPlay control.  I am not talking about replay anyway.  I am talking about live capture using ltmmCapture control

I would like to explain my scenario in details.

I am capturing AVI in ltmmCapture_Mode_Video using ltmmCapture control.  Capturing process is now in progress.  At this time, I want to capture live image from ltmmCapture control without interupting video capture.  The video capturing process will go on after the image captured without break.

LEADTools have different mode for capturing image i. e. ltmmCapture_Mode_Still.  But applying this mode stops capture graph.  I donot want to stop the graph.  In other words, I want the functionality of ltmmCapture_Mode_Video and ltmmCapture_Mode_Still at same time.

For this purpose, currently I am taking screen shot of ltmmCapture control passing the handle of VideoWindow.  But the following problems are with this method :-

- It is platform dependent.  With WindosXP for some display settings, image donot get captured at all.  Some times, it gives white or black image

- It is not giving satisfactory image quality.

- It also donot give you real capture size.  eg. You are capturing video with 752 X 576 capture size.  Size of your ltmmCapture control is 100 X 150 and size of your video window is 100 X 100.  Then captured image size will be 100 X 100 instead of 752 X 576.

- If any other window overlaps ltmmCapture control, that window also appear in image.

I want real time live image with real image properties set to ltmmCapture control (Bits per pixel, Capture Size etc) while capturing Video.

Please give some details of your logic like which objects, methods and properties to use, which help file to refer, and other helpful comments ? It will most welcome if you provide me with sample code.

Hope you got my problem.

Waiting for reply.


Amit
   Report 
  05-24-2006, 15:25
Amin is not online. Last active: 10/29/2008 7:59:53 AM Amin



Top 10 Posts
Joined on 06-27-2005
Posts 749
Re: Simultaneous Image and Video capture

Attachment: VB6CallbackCapture.zip
Reply Quote
Amit,
The concept is the same.
The demo I mentioned in my previous post has 2 differences:
1. It uses the callback filter with the Play control.
2. It takes the frames and modifies them using the image processing COM object.

On the other hand, what you need is:
1. Use the callback filter with the Capture control instead of the Play control.
2. Take a frame (or frames) and save them using the IO COM object instead of the Processing COM object.

Other than that, the method is the same. The callback will give you frames without interrupting the video stream.

I'm attaching a demo I created that shows how this is done with the Capture control and Raster IO object.


Amin Dodin
LEADTOOLS Technical Support

   Report 
  05-25-2006, 10:02
Amit is not online. Last active: 12/17/2008 11:45:37 AM Amit

Top 25 Posts
Joined on 05-10-2006
Posts 168
Re: Simultaneous Image and Video capture
Reply Quote

Thousands of thanks Amin,

I tested your sample, and it is working.

I need to customize it for my needs.  If necessary, I will get in tough of you again.

Thanks again


Amit
   Report 
  05-27-2006, 8:30
Amit is not online. Last active: 12/17/2008 11:45:37 AM Amit

Top 25 Posts
Joined on 05-10-2006
Posts 168
Re: Simultaneous Image and Video capture

Thousands of Thanks Amin,

It is working very fine and exactly for my requirements.

Thanks again.


Amit
   Report 
  08-23-2008, 1:51
roadman is not online. Last active: 12/12/2008 4:56:50 AM roadman

Top 25 Posts
Joined on 06-27-2007
Posts 103
Re: Simultaneous Image and Video capture
Reply Quote
Do you have the same sample in C#.NET? Thanks
   Report 
  08-23-2008, 3:00
roadman is not online. Last active: 12/12/2008 4:56:50 AM roadman

Top 25 Posts
Joined on 06-27-2007
Posts 103
Re: Simultaneous Image and Video capture
Reply Quote
Can you explain more how its work?
   Report 
  08-24-2008, 10:33
Qasem Lubani is not online. Last active: 12/21/2008 9:12:09 PM Qasem Lubani



Top 10 Posts
Joined on 08-13-2006
Posts 1,187
Re: Simultaneous Image and Video capture
Reply Quote

I'm afraid the we do not have the same code in C#. However, the application was written using Our COM objects in VB6 all you need to do is open the application using Visual Studio and Automatically convert it to VB.NET, then do some modification to make it work under C#.

Regarding the other question, can you please tell me which parts you did not understand exactly? Can you give me some details on what you are trying to do?


Qasem Al-Lubani
LEAD Technical Support
www.leadtools.com
   Report 
  08-25-2008, 23:18
roadman is not online. Last active: 12/12/2008 4:56:50 AM roadman

Top 25 Posts
Joined on 06-27-2007
Posts 103
Re: Simultaneous Image and Video capture
Reply Quote
The appilcation will play a video and user can click a button to capture the still images of the playback. The capture will not stop the playback. I am not sure how can make of use of the callback on clicking the button.
   Report 
  08-26-2008, 4:00
roadman is not online. Last active: 12/12/2008 4:56:50 AM roadman

Top 25 Posts
Joined on 06-27-2007
Posts 103
Re: Simultaneous Image and Video capture
Reply Quote

In addition, I would like to ask about the output format of still image.
I noted that there are numerous choices of JPEG format:
LTMMLib.ltmmPlay_StillFormat.ltmmPlay_StillFormat_JPEG411
LTMMLib.ltmmPlay_StillFormat.ltmmPlay_StillFormat_JPEG422
LTMMLib.ltmmPlay_StillFormat.ltmmPlay_StillFormat_JPEG444

Would you please kindly explain the difference on it? Which one will yield a better quality?
It seem that there is slightly difference in RasterImageFormat whereas there is no JPEG444.

Btw, where can i find the API Document of the AxltmmPlayCtrl & AxltmmCaptureCtrl ?

 

 


   Report 
  08-26-2008, 10:11
Qasem Lubani is not online. Last active: 12/21/2008 9:12:09 PM Qasem Lubani



Top 10 Posts
Joined on 08-13-2006
Posts 1,187
Re: Simultaneous Image and Video capture
Reply Quote

You do not have to use the Videocallback to capture a still image during playback. You can use the ltmmPlayCtrl1.SaveStillDIB method to do that.

Regarding the JPEG issue, the StillFormat_JPEG444 has more color details than JPEG422 and JPEG411. But the JPEG411 has higher compression.

The COM multimedia help file has all the details on all the properties including the ltmmPlayCtrl & ltmmCaptureCtrl. The prefix Ax gets added when you use the Visual Studio .Net thats why in the documentation you will find  the control names without the Ax prefix.
Qasem Al-Lubani
LEAD Technical Support
www.leadtools.com
   Report 
  08-26-2008, 11:15
roadman is not online. Last active: 12/12/2008 4:56:50 AM roadman

Top 25 Posts
Joined on 06-27-2007
Posts 103
Re: Simultaneous Image and Video capture
Reply Quote
Thanks alot.

I will capture still image during capturing by ltmmCaptureCtrl Control too. It should be the same problem in the first post of this topic. So, should i need to use the Videocallback for the ltmmCaptureCtrl?
   Report 
  08-26-2008, 11:28
Qasem Lubani is not online. Last active: 12/21/2008 9:12:09 PM Qasem Lubani



Top 10 Posts
Joined on 08-13-2006
Posts 1,187
Re: Simultaneous Image and Video capture
Reply Quote

You will most likely face the same problem and you will need the callback filter. Please review Amin's code sample and explanation on how to use the Filter to avoid this.
Qasem Al-Lubani
LEAD Technical Support
www.leadtools.com
   Report 
  09-08-2008, 23:26
roadman is not online. Last active: 12/12/2008 4:56:50 AM roadman

Top 25 Posts
Joined on 06-27-2007
Posts 103
Re: Simultaneous Image and Video capture
Reply Quote

I have two source of still image capturing. One is from Play Ctrl and the other is from Capture Ctrl using Video Callback Filter. However, I do have a question on the output format.

In the Play Ctrl, the output format is based on the ltmmPlay_StillFormat (Currently i use ltmmPlay_StillFormat_JPEG444)
In the Capture Ctrl, i use video callback filter and save the still image using the codec.save which in term of RasterImageFormat. (Currently i use RasterImageFormat.Jpeg)

Could you please kindly please what is the difference ltmmPlay_StillFormat & RasterImageFormat parameter? I want to synchronize the output quality and format to JPEG444. What is the corresponding format in RasterImageFormat?

 


   Report 
Post
 Page 1 of 2 (20 items) 1 2 »
LEAD Support Fo... » Enduser » Capture & Conve... » Simultaneous Image and Video capture

Powered by Community Server, by Telligent Systems