Welcome! Log In Create A New Profile

Advanced

Processing Time When Saving High Resolution Videos

Posted by swarag_tsk 
Processing Time When Saving High Resolution Videos
July 15, 2022 12:55AM
Hi Jaewon,

ML provides a great way of recording trial by trial videos. But, I am facing a specific issue now. Maybe it is a technical limitation that I am facing, in that case sorry to ask this question. I am using Logitech BRIO 4K web camera for my experiment. I have set my ITI to 2 seconds. But, in reality, it is maximum 20 seconds. When I am not taking input from camera, it is again 2 seconds, and as I am increasing resolution(there is 12 options in this camera) the ITI is becoming larger and larger. Is there anything that can be done to solve this in ML?
I am using HP ProDesk 400 G7 Microtower PC with 10th gen i7 processor and 8 GB DDR4-2933 MHz RAM (1 x 8 Gcool smiley.
Thank you and looking forward to hearing from you soon
kms
Re: Processing Time When Saving High Resolution Videos
July 15, 2022 02:37AM
Hi Jaewon,

We realized you have addressed this question previously (https://monkeylogic.nimh.nih.gov/board/read.php?3,1381,1384#msg-1384).

But since we need the videos to be in hi-resolution for this study, we were wondering if any other alternatives could be tried. For e.g., saving the video at the end of the session, instead of at the end of every trial? Or saving just the timestamps of every frame in each trial while the video is saved independently of ML (by the webcam software, if it is feasible for the webcam to be accessed by two apps simultaneously)?

We also explored the option of using LSL for synchronizing video frames [https://github.com/markspan/VideoCapture] but that is throwing some errors, as of now.

Any other work-arounds or thoughts you have on this will also be much appreciated.

Many thanks!
kms
Re: Processing Time When Saving High Resolution Videos
July 15, 2022 10:47AM
It is all because of the huge size of the video data. There is no other way around but to reduce the data size. No computer can have enough memory to hold an uncompressed video of a whole session, although it depends on the length of the session, of course.

You may be able to set up an external video camera that is capable of hardware encoding (i.e., not a webcam) and send some sync signals from NIMH ML to the camera. I have no knowledge though if there is a video camera that records external signals together.
Re: Processing Time When Saving High Resolution Videos
July 15, 2022 05:32PM
swarag_tsk,

I have a computer similar to yours and it takes just 6 to 7 seconds to save a 10-second trial (webcam format: 1920 x 1080, 30 Hz). Is your trial 30 seconds long?

One difference between your computer and mine is that mine has 32 GB memory. You may want to get more memory and faster disks and see if it shortens the processing time.
Re: Processing Time When Saving High Resolution Videos
July 29, 2022 08:44PM
Try this. First, update to the latest NIMH ML. Then, choose one of the MJPEG formats in the webcam setup and export videos "to the data file with NO compression". See the following link for the details.
https://monkeylogic.nimh.nih.gov/docs_MainMenu.html#Webcam

If you are going to use high resolution, do not monitor the webcam video stream on line. It requires decoding the frame data, which may take a long time due to the large frame size.

The National Institute of Mental Health (NIMH) is part of the National Institutes of Health (NIH), a component of the U.S. Department of Health and Human Services.