loading
 
Saving AVI
Steve Woodrough from United States  [46 posts]
2 years
STeven,
I'm trying to set up a fixed time record based upon a condition of a certain variable SPEED.  The attached file does record but only while the variable SPEED exceeds the threshold.  What I am looking to do is this:
Each time the SPEED threshhold is met, record for 12 seconds. At the end of the 12 seconds stop, save the file and wait for the next record condition.   Since there may be breaks in the SPEED sensor data, DO WHILE logic might be more appropriate.  In this case is would be DO WHILE SPEED > 1  AND continue to record for some addtional period to act as a buffer.
Any guidance you can provide is appreciated as ALWAYS!!

Regards,
Steve
program.robo
Steven Gentner from United States  [1370 posts] 2 years
Steve,

I think you were on the right direction. The pipeline is essentially in a while loop processing each frame that comes along. What you just needed was the right combination of If statements in order to trigger recording while speed > 0 and continue for another 10 seconds after speed becomes zero for additional buffer.

Its easier to use the video writing module using the command variable where you tell it what actions to do and what filename to use. See the attached. Seems to work for me to record for at least 10 seconds when SPEED variable is triggered.

Note, you probably need to change the video_filename path that is set in the Set_Variable module to something that exists in your system. Right now it is set to c:\temp\

STeven.

program.robo
Steve Woodrough from United States  [46 posts] 2 years
STeven,
I reserve the right to be wrong.  After taking the time to experiment with the Write avi module I figured out to uncheck the Use Real Time function.  This gives me nice collection of video snippets inside of an avi.  Sometimes the avi closes, but a new one starts with next file number sequence.  It actually seems to work pretty well and in hindsight is preferable to a bunch of avi files.  Since my camera is fixed it is difficult to discern when one snippet ends and the next begins.  Is there a good (easy) way to keep the video snippets in a single avi, but add a sort of transition title to the end of a snippet, maybe even sequentially numbered?
Thank You
Steve


program.robo
Steve Woodrough from United States  [46 posts] 2 years
STeven,
I put a bit of skin in the game here.  Attached is my attempt, but it does not appear to be working.  I think I'm close but may have some flawed logic.  
Thanks for your help and example and I look forward to hearing back.
Regards,
Steve
program.robo
Steve Woodrough from United States  [46 posts] 2 years
STeven,
I got a visit from the idea fairy tonight.  Want to include the fastest speed recorded from one of the video snippets into the saved avi file name.  This way I can go right for the ones im looking for.  I'm close but the avi closes after each video and I can't figure out how to reset the max_speed variable back to zero at the start of the avi.  I'd still prefer to just have a collection of snippets in a given avi file.  See attached attempt.
Thank You
Steve
program.robo
Steve Woodrough from United States  [46 posts] 2 years
STeven,
Ignore last two posts, unless you want to memorialize the exercise.  I've taken a simplified approach and only record the speeds over a certain threshhold.   Keeps the videos short and to the point.  
Regards,
Steve
Steven Gentner from United States  [1370 posts] 2 years
Thanks for the follow up! Yes, there are many ways to solve this project which is both a good and bad thing! I would imagine that shorter videos are also easier to work with since Win Explorer should show a thumbnail image of each video which might make accessing a particular video easier than spending time with a much longer video.

Anyhow, glad you found a solution that worked for you.

Cheers,
STeven.

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index