LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Save video file usb webcam

Hi forum,

 

Currently i have USB Logitech webcam which i will use for my project. I have successfully acquire the video image by using USB Acquisition. My question is: is it possible to save the video to an avi file while labview is acquiring the image from webcam? I have tried to look at Grab and Save to AVI which is in example but an error occured teeling me that no interface is found. How to solve this?

0 Kudos
Message 1 of 7
(5,675 Views)
You cannot have multiple sessions open at the same time.
Message 2 of 7
(5,665 Views)

Hi hito88,

 

Grab and Save to AVI is for NI-IMAQ cameras (Analog, Parallel Digital, CameraLink). USB cameras that are DirectShow compliant use IMAQdx (as of Vision Acquisition 2009).

 

So the short answer to your question is yes, you can. The longer answer is you'll need to change Grab and Save to be IMAQdx instead. Modify the file accordingly and it should work.

 

muks is right that you can't have multiple sessions open at the same time, but this operation wouldn't require that.

Jeff | LabVIEW Software Engineer
Message 3 of 7
(5,649 Views)

 


muks is right that you can't have multiple sessions open at the same time, but this operation wouldn't require that.
Jeff,

 

You are right. You can do that.

0 Kudos
Message 4 of 7
(5,623 Views)

Hi Jeff,

 

I need some help with an application similar to the one fr this post. I am using a similar system as the one in the original post (usb 2.0 webcam, IMAQdx and directshow). I need to record videos at constat FPS (30 as the camera can do this), make sure the FPS is constant and also that I am not missing any frame. I need to record videos of 2 min duration. Any suggestions on how to go about it.

 

Please let me know if you can help me with this.

 

Thank you in advance, best, Massi.

0 Kudos
Message 5 of 7
(4,708 Views)

Hi Massi,

 

First off, this thread is quite old (2010). In the future, create a new thread so the community will be able to assist you better.

 

If your camera is DirectShow compliant, the IMAQdx drivers should allow you to capture fames in Measurement and Automation Explorer (MAX). Check first if you are able to perform a grab in MAX. You can also configure your camera’s parameters here as well (to make sure it is outputting at 30 fps).

 

To record the output in LabVIEW without missing any frames, there are a couple of examples that should provide the functionality we are looking for. In the NI Example Finder (found by in LabVIEW going to Help >> Find Examples) the first example is located under Hardware Input and Output >> IMAQdx >> High-level >> Grab and Detect Skipped Buffers. This VI will allow you to acquire from the camera and see if you are missing fames.

 

The next example is located under Hardware Input and Output >> IMAQ >> File Input and Output >> Grab and Save to AVI. This example uses IMAQ drivers (not the IMAQdx drivers that we need to use with the camera); the coding for saving to an AVI file is all we need. If you combine these two examples, you should be able to save to an AVI file and see if you are missing any frames.

------------------------------
Bill E. | Applications Engineer | National Instruments
0 Kudos
Message 6 of 7
(4,696 Views)

Hi Bill,

 

thank you for your tips and reply. I apologize about posting something in an old post. I just did not think I should create another post as every time I search for something I get so many hits that it is crazy to sift through, but I totally understand your point.

 

In any case, I have looked at your solutions. I have played around with both of them and I think I am going to do a mix and match of things. I will post my final solution here in case anyone is interested and that may want to use it or improve it for their own sake or application needs.

 

Have a wonderful day,

best, Massi.

0 Kudos
Message 7 of 7
(4,688 Views)