Output videos of variable length

139 views
Skip to first unread message

Naman Agrawal

unread,
Apr 19, 2022, 2:13:31 PM4/19/22
to Bonsai Users
Hi all!

I am trying to do simple tracking of flies in a circular arena. I have 4 arenas under one FLIR Blackfly camera. Attached is my workflow and the settings I have on Spinview for the camera.

The problem I am facing is : the output videos from my workflow have variable length. According to the workflow, they should all be exactly of the length 29 minutes.

I have set the Videowriter node's Framerate to 30. As per some previous discussions in this group, here are my settings for in the SpinView software -

Acquisition mode - Continuous
Acquisition Frame Rate Enable - OFF
Exposure mode- Timed
Exposure Auto - OFF
Exposure Time - 3672
Gain Auto- Off

Can someone please help me with this ? I am really new to this, so sorry in advance if I am making a stupid error.

Best,

Naman

Capture.PNG
BinaryChoice-food_v0 (1).bonsai

brunocruz

unread,
Apr 20, 2022, 6:02:26 AM4/20/22
to Bonsai Users
Heya, 
When you say variable, do you mean among videos of the same workflow, or among workflows? Also, how variable? Are you referering to a few frames or minutes? From your workflow I would expect videos to be around 2 hours and 20min if you are saving at 30fps. (170FPS / 30FPs * 28min). Can you confirm this is indeed what you are getting?
Cheers,
B

Naman Agrawal

unread,
Apr 20, 2022, 2:27:57 PM4/20/22
to Bonsai Users
Hi Bruno,

By variable, I mean videos among different runs of the workflow. Sometimes the videos come out to be around 32 minutes long, sometimes 33 minutes long. But since my workflow has a timer node for 29 minutes, I fail to understand why the length of the videos should exceed the time for which the workflow is being run, further why would they be of different lengths every time I run the workflow.

No when I am saving at 30fps, I am getting the videos around 33 minutes long. When I set the Videowriter node's Framerate to 170, I am getting videos around 5 minutes. So I am assuming the output videos are getting slowed down or sped up when they are being written. My question is how do I prevent this ? how do I maintain the videos to of real-time length?

Best,

Naman

brunocruz

unread,
Apr 21, 2022, 3:57:37 AM4/21/22
to Bonsai Users
From what you are describing it sounds like your camera frame rate is around 35fps and not 170. Can you confirm this by checking the difference between two adjacent frames in the metadate of the camera?

Naman Agrawal

unread,
Apr 21, 2022, 11:11:34 AM4/21/22
to Bonsai Users
Hi Bruno,

I think I solved the issue. I enabled Acquisition Frame Rate and set it to 30Hz (now it matches the fps rate of my videowriter node). I was confused by one of the previous questions in the group where it was recommended to turn Acquisition Frame Rate Enable to Off.

I also think the working memory of my computer was running out by 4 Video Writing nodes. So I disabled one of the nodes, and it now seems to working fine.

Thanks for the help !

kapil...@gmail.com

unread,
Dec 5, 2023, 5:38:41 PM12/5/23
to Bonsai Users
Can this be done in the Spinnker Capture node as well, i am getting 66 FPS in Flir camera and cant reduce it to 30 FPS? ANy help would be great.
Reply all
Reply to author
Forward
0 new messages