Solved

capture one video frame as save as bitmap

Posted on 1998-01-26
9
422 Views
Last Modified: 2010-08-05
I have an Intel Video Input Card. I can save the video as an avi file with Video for windows but how can I capture one frame and save it as a bitmap using Visual Basic
0
Comment
Question by:aktis
  • 3
  • 3
  • 3
9 Comments
 
LVL 1

Expert Comment

by:Future
ID: 1453500
Ahh, an easy one :-)... just pause the video and press Alt-Printscreen.  Then start a paint program and paste the graphic.  It should be easy then to remove the border (I do this all the time, just select the picture part and copy/paste to a new graphic).  Hope this is an adequate answer.  It does work pretty nicely for just about any kind of window capture.
0
 
LVL 1

Expert Comment

by:Future
ID: 1453501
Oops.. I missed the "using Visual Basic" part, sorry about that (doh...).  Well... This would be something of a pain to do using plain old visual basic and would probably require some API calls.  I guess I'll let someone else answer it since I've never done anything like that with VB.
0
 
LVL 1

Author Comment

by:aktis
ID: 1453502
Adjusted points to 100
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 7

Accepted Solution

by:
kamall earned 100 total points
ID: 1453503
aktis,
Using VB, you can play the video in a picture box using the MCI control (I assume that you know how). On your form, put one command button and one text box. In the 'Click' event of the command button write this code:

SavePicture Picture1.Image, Text1.text

Then, whenever you want to capture a frame, click the pause button on the MCI control, and in the textbox enter the file name you want to save the frame to ("c:\myframe.bmp"), and then Click your command button to save the frame.

If you want information (code) on how to play a video in a picture box using the MCI control, please drop me a comment.

Best regards.
0
 
LVL 7

Expert Comment

by:kamall
ID: 1453504
aktis,
In my answer above I assumed that you allready have captured the video first, and saved it as an AVI file.
0
 
LVL 1

Author Comment

by:aktis
ID: 1453505
Thanks but my problem is than I haven't allready captured the video. I has only one video input card connected to a video.
0
 
LVL 1

Expert Comment

by:Future
ID: 1453506
aktis,

The only way I would think you could possibly do what you want is to contact Intel and see if you can get a list of DLL's that came with the software for your video input card (the drivers, etc) and a list of the API calls associated with the software that drives the card.  Otherwise, there is no way to interface with the card(well, no way unless you had detailed info from Intel about interacting directly with their hardware, an extremely unlikely event).
0
 
LVL 1

Author Comment

by:aktis
ID: 1453507
Is there a common protocol between video capture cards?
0
 
LVL 7

Expert Comment

by:kamall
ID: 1453508
Hi aktis
Sorry for being away for a few days.
From your comments, I understand that you want to capture a frame directly from the video source in visual basic. As Future said, you must use one or more DLL's that come with the capture card software to be able to do what you want directly from visual basic. And regarding your last comment about if there is a common protocol between video capture cards, the answer is NO. Each manufacturer develops his own drivers and DLL's for his card.
Now regarding your original question, you can SHELL the capture software from your VB program, capture the video sequence, close the capture program, and play the clip just captured in your VB program to do the frame capture.
Best Regards.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MS Access - Capture pressed key onclick 4 33
vb6 connector to mongodb 2 82
Excel Automation VBA 19 69
which modules are active in VB6 project? 6 10
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question