Prolems About V4 Record Frame Loss

330 views
Skip to first unread message

changhao liu

unread,
Jan 9, 2021, 8:45:10 AM1/9/21
to Miniscope

Hi Daniel,

I am trying to record data (using the DAQ software for v4), and I found some problems and would like to ask for your help.

1I found that there is a phenomenon of video frame loss. For example, when I record data (fps: 30 Hz and length: 300 seconds), and the actual number of frames collected is 8935, not the ideal 9000 frames. Is this OK?And how coulld I find where the frame is dropped during recording data?

2I learned from the website(http://miniscope.org/index.php/Data_Acquisition_Box) that DAQ's J5, when a frame is recorded, there is a switch to the output. However, in my actual collection process, sometimes the number of captured frames is different from its output switching times. Is this normal?1.png


Thanks for your help.
Changhao

changhao liu

unread,
Jan 10, 2021, 1:46:23 AM1/10/21
to Miniscope

Here is the frame and toggles's result of recording data  (using the DAQ software for v4)for reference

record.png
Thanks for your help.
Changhao

Daniel Aharoni

unread,
Jan 11, 2021, 4:54:57 PM1/11/21
to Miniscope
Hi Changhao,
Thanks for the detailed post! 

The UVC protocol we use to send video frames from the Miniscope DAQ to the computer has the possibility of frame drops when the USB port on the computer is not able to keep up with the data stream coming from the Miniscope DAQ. The Output Toggles of the DAQ will account for every since frame that was received by the Miniscope DAQ but once in a while you will get a DAQ output toggle without that frame making it all the way to the computer. This is a dropped frame and will show up as a difference in Output Toggles and TimeStamp_num. The rate of frame drops will depend on your computer hardware, and to a lesser extent, the stability of the coax cable connection between the Miniscope and DAQ. It looks like you are averaging just a few frame drops per 10K frames which should be very very minor. The timeStamp.csv file only saves time stamps of non-dropped frames, so just use these frame numbers and timestamps for analysis.

Also, while you can set the FPS as "30FPS" or 20FPS" (for example) the actual FPS will be very slightly off from exactly that number. So instead of a frame length of exactly 33.333333ms for 30FPS it might be 33.3ms or 33.4ms. This will end up resulting in not exactly 9000 frames for 5min. This slight difference is due to the timing resolution of the registers within the image sensor.

Let me know if you have any other questions I did not address.

elham ghanbarian

unread,
Jan 18, 2021, 2:59:56 PM1/18/21
to Miniscope
Hi Daniel, 

Thanks for explaining this, it was my question too. Is there a way to find where the frames are dropped?

Elham 

Daniel Aharoni

unread,
Jan 19, 2021, 1:40:38 PM1/19/21
to Miniscope
The Miniscope software does not save information about where/when a frame was dropped. Generally speaking though, you can look at the timestamps for the Miniscope recording and detect a frame drop by finding interframe intervals that are ~2x longer than what would be expected with the FPS you are running at.

elham ghanbarian

unread,
Jan 26, 2021, 2:31:48 PM1/26/21
to Miniscope
Hi Daniel, 

Here you mentioned that "the rate of frame drops will depend on your computer hardware". Would you please advise on the best hardware specs to avoid losing frames? Do you recommend an SSD drive? Is there any USB cable that worked better than the others in your hands? How much RAM is required? 

Thanks,
Elham 

On Monday, January 11, 2021 at 1:54:57 PM UTC-8 dbah...@gmail.com wrote:

Daniel Aharoni

unread,
Feb 1, 2021, 1:07:21 AM2/1/21
to Miniscope
Hi,
Frame drops generally don't have to do with the write speed of your storage drive or the amount of RAM you have. It generally has to do with how fast your USB bus/port is and if there are other devices on the bus keeping it busy. It also has a bit to do with the speed of your CPU. Dropped frames shouldn't be much of a concern as long as they are happening at a low rate. Even if you were dropping 1 frame a second (which I would consider very very high), it effectively just changes your overall FPS from 30FPS to 29FPS or 20FPS to 19FPS. On a stable system you should maybe expect a dropped from for every 1000 frames acquired. The timestamp file keeps track of this so there isn't much of an issue with losing a frame every once in a while.

Reply all
Reply to author
Forward
0 new messages