LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I make a program to loop a video feed in LabVIEW 8.0?

Well I messed around with the example program of the lighter clip being recorded to a .AVI file but I had no luck in making my video feed from my USB camera record... Any hints?
0 Kudos
Message 11 of 41
(2,136 Views)
If you have the IMAQ USB VIs working, then you should be able to take the "Image Out" from a IMAQ USB Snap or IMAQ USB Grab and send it to a AVI Write Frame (Functions » Vision and Motion » Vision Utilities » Files » AVI). There is a good example of this in the LabVIEW Example Finder (Help » Find Examples...). You can find "Grab and Save to AVI" by searching for "AVI" in the examples. This example uses the IMAQ VIs instead of the IMAQ USB VIs, so you will have to swap those out.
Chris Bolin
LabVIEW Partner Program, CLA
Message 12 of 41
(2,119 Views)

I accomplished something similar to this for a current project by capturing individual video frames to a lossy queue and writing them to a motion-jpeg formatted file when an event occurs. The only issue with this method is that it might be outside of the memory capabilities of a SBC, especially if you're hoping to store 5 minutes of video, or you need a particularly high frame rate.

 

Keeping individual frames in a ring buffer-type construct may be the way to approach the logistical challenge of keeping X-seconds of video in memory prior to an event. Getting those frames into the playback format of your choice is another issue.
0 Kudos
Message 13 of 41
(2,086 Views)

CXB wrote:
If you have the IMAQ USB VIs working, then you should be able to take the "Image Out" from a IMAQ USB Snap or IMAQ USB Grab and send it to a AVI Write Frame (Functions » Vision and Motion » Vision Utilities » Files » AVI). There is a good example of this in the LabVIEW Example Finder (Help » Find Examples...). You can find "Grab and Save to AVI" by searching for "AVI" in the examples. This example uses the IMAQ VIs instead of the IMAQ USB VIs, so you will have to swap those out.

Well Thank you for that info, I got the program to record from the USB camera to an .AVI file, that was really exciting! LOL 

 

 


AlexK wrote:

I accomplished something similar to this for a current project by capturing individual video frames to a lossy queue and writing them to a motion-jpeg formatted file when an event occurs. The only issue with this method is that it might be outside of the memory capabilities of a SBC, especially if you're hoping to store 5 minutes of video, or you need a particularly high frame rate.

 

Keeping individual frames in a ring buffer-type construct may be the way to approach the logistical challenge of keeping X-seconds of video in memory prior to an event. Getting those frames into the playback format of your choice is another issue.

Well 5 minutes was a very rough guess. For our application, maybe even just one minute would be enough to capture what happens during a car accident. I need to figure out what our next step should be.. Maybe figuring out what I need to add to the program now for the accelerometer data acquisition.. I'm not sure exactly, this is all new to me, but I still want to make an A! 

0 Kudos
Message 14 of 41
(2,080 Views)

I have some new questions. We now need to come up with our own interface for an accelerometer to our computer. The NI DAQ board is way too expensive for our little school project. We were thinking we need it to be a USB or Serial input. This part is the "unique" portion of the project, meaning it will be something that we design ourselves. The professors like the use of LabVIEW for the software portion of it but they are looking for a hardware design. I was hoping I could get some guidance on where to go for the DAQ device.

 

Also, we need to figure out a way to power the SCB from a 12V source (since a car battery is 12V). Any tips on how to go about it?

 

I will also need help soon programming our LabVIEW software to get the accelerometer to fit in with what we want it to do.

 

Thanks in advance.

0 Kudos
Message 15 of 41
(2,005 Views)
What type of accelerometer are you using? What is the format of the output, just a DC voltage level?
0 Kudos
Message 16 of 41
(1,980 Views)

AlexK wrote:
What type of accelerometer are you using? What is the format of the output, just a DC voltage level?

 

 

We don't have the accelerometer quite yet, but we were thinking of a common 2-axis surface mount chip..

 

I believe we are looking for a DC output voltage level. We will probably need an analog to digital converter right?

0 Kudos
Message 17 of 41
(1,976 Views)

PSUstudent wrote:

 

We will probably need an analog to digital converter right?


Yes... from your previous post, you made it sound like you were designing a data acquisition device (which will require an ADC)...

 


PSUstudent wrote:
This part is the "unique" portion of the project, meaning it will be something that we design ourselves. The professors like the use of LabVIEW for the software portion of it but they are looking for a hardware design.

 

Chris Bolin
LabVIEW Partner Program, CLA
Message 18 of 41
(1,968 Views)

Hello all, I'm back! Since I last posted we have came a ways from where we were in August. We now have a program that will display and record video from a USB camera and save it to a specified file location. Now we need to modify the program to loop over itself every 3 minutes, and then STOP looping after an external source (such as an accelerometer) tells it to stop looping and save the current video loop. Ideas?

 

Here is our current design:

 

LabVIEW Design 

0 Kudos
Message 19 of 41
(1,881 Views)

Hi John,

 

You can just change the stop condition for the loop that you've built.  Currently the loop stops when you hit the stop button.  Instead, you can make it so that the loop stops when 3 minutes have elapsed.  Then, you can place another while loop around the case structure that stops when the accelerometer value goes high.  This architecture should serve you well.  Thanks.

Stephen Meserve
National Instruments
0 Kudos
Message 20 of 41
(1,855 Views)