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?

We now have the program modified to loop a video feed for 10 seconds, and then loop over itself and save the .avi file on the desktop until the stop button is pressed.. Our problem now is that after the stop button is pressed, the current video feed is not saved, but the feed that starts AFTER you press the stop button is saved. Here is what we have:

 

 

0 Kudos
Message 21 of 41
(2,192 Views)
Have you tried closing the AVI session before the camera session?
Stephen Meserve
National Instruments
0 Kudos
Message 22 of 41
(2,189 Views)

If I understand your requirements correctly, you're wanting to capture video around the "stop" condition, not just after the stop condition. As I think I mentioned earlier, a lossy queue may be the simplest way to achieve this.

 

I whipped up a quick chunk of quasi-code to show an example of what I'm talking about. This won't compile, but it should hopefully give you an idea of an architecture which will give you that capability.

Message 23 of 41
(2,187 Views)

AlexK wrote:

If I understand your requirements correctly, you're wanting to capture video around the "stop" condition, not just after the stop condition. As I think I mentioned earlier, a lossy queue may be the simplest way to achieve this.

 

I whipped up a quick chunk of quasi-code to show an example of what I'm talking about. This won't compile, but it should hopefully give you an idea of an architecture which will give you that capability.


Yes, we do want to capture video around the stop condition, for instance, if the accellerometer engages at 2:59 in a 3:00 minute loop, we wouldn't have a significant amount of the necessary video recorded, only one second for that loop. We looked over your .jpg and we're not exactly sure how to impliment it into our program. Could you maybe go into more detail about what "lossy queue" means? Thanks

0 Kudos
Message 24 of 41
(2,152 Views)

A lossy queue is a queue which, after it has reached it's maximum size, deques the "oldest" element each time a new element is enqueued.

 

Using simple integers as an example, consider a lossy queue with a 5 element maximum length:

 

Queue: 7 - 19 - 22

 

Enqueue: 5

 

Queue: 5 - 7 - 19 - 22

 

Enqueue: 11

 

Queue: 11 - 5 - 7 - 19 - 22

 

(Now the queue is "full", meaning each new element will "bump" the oldest element out of the queue)

 

Enqueue: 3

 

Queue: 3 - 11 - 5 - 7 - 19

 

Enqueue: 56

 

Queue: 56 - 3 - 11 - 5 - 7

 

Enqueue: 19

 

Queue: 19 - 56 - 3 - 11 -5

 

 

... Now apply the same concept with "images" from your IMAQ grab function (instead of simple integers as above), and the result is that you have the N (length of your queue) most recent elements stored at all times, regardless of when you try to stop the recording loop. Instead of just creating and overwriting a new AVI file every three minutes, you simply store the most recent three minutes worth of frames in a queue, and then write them to a new AVI file after your event has occurred.

Message Edited by AlexK on 02-19-2009 02:31 PM
Message 25 of 41
(2,147 Views)

AlexK wrote:

If I understand your requirements correctly, you're wanting to capture video around the "stop" condition, not just after the stop condition. As I think I mentioned earlier, a lossy queue may be the simplest way to achieve this.

 

I whipped up a quick chunk of quasi-code to show an example of what I'm talking about. This won't compile, but it should hopefully give you an idea of an architecture which will give you that capability.


So on that example, which LabView are you using? Is it just a generic compilation or am I missing icons that you have? We have version 8.0... Keep in mind we are 100% new to LabView and might need more help than others might need!

 

Your lossy queue idea sounds great and I'd like to get it to work for our project!

0 Kudos
Message 26 of 41
(2,124 Views)
Bump
0 Kudos
Message 27 of 41
(2,062 Views)
There's a hint in the name 'Queue'. Try searching the LabVIEW Examples.
Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 28 of 41
(2,047 Views)

I have LabVIEW version 8.6 Professional. Queue functionality is definitely available in your version of LabVIEW (in mine it is in the Programming -> Synchronization -> Queue functions pallet). I do seem to remember, however, that the Lossy Enqueue function was added in recent versions; I'm not sure if that feature got in before or after 8.0.

 

The suggestion to poke around some Queue examples is a good one. If your version of LabVIEW doesn't include Lossy Enqueue, the same functionality is very easily produced using the other queue functions.

Message 29 of 41
(2,030 Views)

AlexK wrote:

I have LabVIEW version 8.6 Professional. Queue functionality is definitely available in your version of LabVIEW (in mine it is in the Programming -> Synchronization -> Queue functions pallet). I do seem to remember, however, that the Lossy Enqueue function was added in recent versions; I'm not sure if that feature got in before or after 8.0.

 

The suggestion to poke around some Queue examples is a good one. If your version of LabVIEW doesn't include Lossy Enqueue, the same functionality is very easily produced using the other queue functions.


Yeah I found all the Queue functions in 8.0 and sure enough Lossy Queue isn't one of them... Which Queue function would be a good substitute for what we need? The Queue Stack - LIFO? Seems like it is almost the same as what we need..

0 Kudos
Message 30 of 41
(2,020 Views)