02-18-2009 02:54 PM
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:
02-18-2009 03:13 PM
02-18-2009 03:28 PM
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.
02-19-2009 01:58 PM
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
02-19-2009 02:30 PM - edited 02-19-2009 02:31 PM
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.
02-20-2009 12:25 PM
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!
02-26-2009 02:46 PM
02-26-2009 05:02 PM
02-27-2009 08:18 AM
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.
02-27-2009 12:06 PM
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..