Get specific frames from video

159 views
Skip to first unread message

Bruno Cruz

unread,
Jun 26, 2016, 1:55:36 PM6/26/16
to Bonsai Users
Hi!,

I am trying to grab a a list of small clips from a bigger video. Ideally i would give a list frames (a CSV file with 2 columns (first and last frames) for instance) that i want to grab and save the smaller clips.

Anyone has an example on how to do this?

Thanks,

Bruno

goncaloclopes

unread,
Jun 26, 2016, 8:07:20 PM6/26/16
to Bonsai Users
Here it is (also attached), perhaps a little more involved than necessary, but doable.
Remember to always keep the last frame larger than the first frame.

The basic idea is to use CsvReader to scan and parse the lines from the CSV file, followed by a WindowWorkflow that will, for each line of the CSV, create a sequence of frames. Because I'm using a logic where I start the FileCapture in a particular frame and then Take a certain number of frames, I subtract the last frame from the first frame to get the total number of frames in each clip. Finally, I send all the frames from each clip to a VideoWriter, which will write the clips.

Hope this helps.
saveclips.bonsai

Bruno Cruz

unread,
Jul 3, 2016, 7:24:09 AM7/3/16
to Bonsai Users
Thanks! after some minor changes worked really nicely!!! Feel free to close the topic ;)
Reply all
Reply to author
Forward
0 new messages