codec of V3 videos

199 views
Skip to first unread message

kaizh...@gmail.com

unread,
Apr 27, 2021, 8:49:02 AM4/27/21
to Miniscope
Who knows the codec or compression format for V3 recorded videos?
As I have both V3 and V4 running in the lab, I want to keep consistency for analysis. I want to avoid using FFV1 compression in V4 recording, but not sure which one to choose to have the same format as V3 videos.
Best regards,
KL

Daniel Aharoni

unread,
Apr 27, 2021, 3:22:59 PM4/27/21
to Miniscope
Hi KL,
The older Miniscope software that was developed before the V4 Miniscope release saves all video data in fully uncompressed format. The new Miniscope software which supports both V3 and V4 Miniscopes can allow you to define a compression codec. All compression codecs will be compatible with all versions of Miniscopes. If you don't want to use FFV1 then I suggest using GREY. This is effectively a completely uncompressed video codec equivalent to what the old Miniscope software used.

Martin Jendryka

unread,
Jul 30, 2021, 4:41:13 AM7/30/21
to Miniscope
Dear Daniel,
I also changed to the v4 miniscope and use the GREY codec to keep my data consistent with my older data recorded with the v3 miniscope (older DAQ board version). 

Ive noticed that whereas the individual avi files (each containing <= 1000 frames) are 50s long when recorded with the older v3 miniscope , the avi files recorded with the v4 are 16s long and the frames are played at a much faster speed when opened with the vlc player. The size of each avi file between the v3 and v4 miniscope is roughly similar (difference in the total size of all avi files: 500 mb).
 
What is the reason for this and how can I change it to normal speed? Do you think this might have any effect on the preprocessing or the data analysis in general?

Best regards,
Martin   

Federico Sangiuliano

unread,
Jul 30, 2021, 5:11:27 AM7/30/21
to Miniscope
Hello Martin. VLC incorrectly assumes that the frame rate (FPS) of the videos are 60 FPS. Supposing that your videos are 1000 frames long, the reason you see that videos are 16 seconds long is due to the following calculation

1000 frames / 60 frames*seconds = 1000/60 seconds = 16.67 seconds

which, unless you are effectively recording at 60 FPS, is wrong. The v4 miniscope can record at a maximum of 30 FPS, so reproducing the video at 60 FPS results in a video twice as faster. To visualize the videos with the correct FPS I use FIJI. To change the FPS, load a video and go to the following setting

fiji2.png

The Animation Options will open the following dialog

fiji3.png

In the Speed space you can enter the FPS setting you used to record the video, for example 20 of 30 FPS. In the screenshot above shows 60 FPS, which is an incorrect value that also FIJI assumes. After clicking OK the video will play at the right speed. It's important to notice that this only matters for visualizations purposes and does not have any effect in the analysis. Some pipelines (as CaIman) asks you to enter the FPS used in the recording.

I hope this helps

Thank you

Federico

Martin Jendryka

unread,
Jul 30, 2021, 10:47:17 AM7/30/21
to Miniscope
Hi Federico,
thanks for your quick reply! It worked. Good to be re-assured that it wont have any effects on the data analysis.

I am trying to find a reason why I cant find responsive cells in my new v4 miniscopes recordings. I would be glad if you, Daniel or anyone who feels confident enough could share her or his thoughts on the following:

Just by looking at the live image (raw or dF/F) during the on-going recordings I can clearly see that whenever the animal receives the reward in a trial, almost all imaged cells go silent from the timepoint of reward retrieval until a few seconds after. However, I am not able to see that when creating PETHs aligned to the reward event. The peaks for each trial are widly distributed leading to an average activity trace that is flat and near to zero for all cells (see left figure for example cell with traces for each trial).  
On the other hand, with my older recordings using the v3 miniscope (and the older DAQ box and software) I can clearly see that cells increase or decrease their activity near the timepoint of the event (see middle and right figure). Also, the traces are simliarly aligned for each trial and the amplitude is much higher. 


Unbenannt.PNGUnbenannt.PNGUnbenannt.PNG
All traces were pre-processed using MIN1PIPE and what is plotted above are the output traces without any normalization. Importantly, the traces of the left figure were pre-processed with the latest version, where as the traces of the middle and right figure were pre-processed with an older version from 2019. Im about to find out if that might be the reason (but I doubt it). 

If anyone could help me with this, I would be very grateful.

Best,
Martin   

Daniel Aharoni

unread,
Jul 30, 2021, 4:03:00 PM7/30/21
to Miniscope
Hi Martin,
I want to make a very critical clarification here. You absolutely must use the timestamps stored in the timeStamps.csv file when figuring out the timing of each acquired frame. You cannot assume a consistent framerate and just extrapolate the timing from that.

When our software creates a new .avi file we need to define the playback FPS. By design, we have chosen that to be noticeably faster (60FPS) than what people actually record at (30FPS or lower). When visually inspecting recorded data, it is often easier to see neural dynamics by eye when the video is played back faster but the default playback FPS should not be used in actual analysis (this is true for older V3 recordings as well). 

In the plots you posted today, was the analysis on the newer data using the timing in the timeStamps.csv file or were you just extrapolating the timing based on the expected average FPS (e.g. 30FPS)?

Martin Jendryka

unread,
Jul 31, 2021, 10:27:16 AM7/31/21
to Miniscope
Hi Daniel,
thanks for your quick reply! 

I always use the timestamps saved in the timestamps csv file for both v3 and v4 miniscope recordings. To find the calcium signal frames which correspond to a time window around the behavioral event (e.g. as showed in my earlier reply), I extract the calcium signal for the timestamps that are closest to the behavioral event timestamp (recorded by PyControl).

However, I guess the reason for my issue is the latest MIN1PIPE version. I used an older recording (preprocessed with an older MIN1PIPE version), for which I see the event-responsive cells and re-ran the preprocessing with the latest MIN1PIPE version. Interestingly, I was not able to find any activity traces anymore that would be aligned to the event, but that calcium peaks are widly distributed for each trial as shown in my earlier reply.

Not sure if I'm on the right track. Advices as always welcome. Will also ask the MIN1PIPE developer what he thinks about that and keep you updated.

Best,
Martin  

Zachary Zeidler

unread,
Jul 31, 2021, 11:23:59 AM7/31/21
to Martin Jendryka, Miniscope
Hi Martin,

Out of curiosity -- are you spatially downsampling your V4 recordings?
I've used MIN1PIPE with V3s and I'm starting to use them with V4s. One difference I noticed is that, at least in my hands, with V4s I *must* spatially downsample -- a factor of 2 worked for me (recording in PFC). If I don't spatially downsample, MIN1PIPE vastly overseeds (by ~50%). This is despite taking into account changes in the seed size (which does change the ROIs detected, but not nearly as drastically as the spatial downsampling). 

Best,
Zach


--
You received this message because you are subscribed to the Google Groups "Miniscope" group.
To unsubscribe from this group and stop receiving emails from it, send an email to miniscope+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/miniscope/366879c5-db60-4a4b-9a36-8d2a0902e360n%40googlegroups.com.

Martin Jendryka

unread,
Jul 31, 2021, 12:23:07 PM7/31/21
to Miniscope
Hi Zach,

yes, so far I have always spatially downsampled by 2 with the seed size set to 5 for both v3 and v4 miniscope data. 
Have you noticed any differences in the traces when re-processing your older data with the latest min1pipe version, as described in my previous message? Or maybe you find that the v4 traces behave differently from the v3 traces at the same experimental settings?

Would be keen to know if I am the only one having this issue.

Best, 
Martin 

Reply all
Reply to author
Forward
0 new messages