Synchronize externally played video (in VLC player) with spike2

Discussions and questions about topics not covered above
amyvanhattem
Posts: 1
Joined: 20 Jul 2020, 19:13
Contact:

Synchronize externally played video (in VLC player) with spike2

Unread postby amyvanhattem » 21 Jul 2020, 08:42

Hi everyone,

I've run into a slight problem and hope to find some insights here. Apologies in advance if a similar question has popped up previously.

I have spike2 recording the eye movement in the horizontal and vertical axis and run an optogenetic stimulation sequence. At the same time I want to play an OKR video as visual input that we've designed and saved as a VLC video playlist (.xspf). At this time, I manually open a VLC video playlist and press play, and as soon as possible in spike2 press a keyboard marker to indicate when the video roughly started playing and trigger the optogenetic stimulation sequence. Of course, this method is highly variable and inconvenient for data analysis.

Ultimately, we want to open the OKR video and synchronize it with spike2 and the stimulations. So what needs to be done is that (1) when the video starts, spike2 starts recording or (2) while spike2 is recording and the video starts playing a marker is set automatically, and the optogenetic stimulation starts. For the analysis, it is important that in spike2 we know exactly at which second the video started playing.

Is there a way to mark exactly in spike2 when the video starts, so t = 0 for video? For instance that spike2 sends a signal to VLC to start the video (and marks this) or that spike 2 receives a signal when the video starts, marks this, and uses this signal as a trigger for the stimulation sequences.

Thanks a lot for the help,
Amy van Hattem

Pawel Kusmierek
Major contributor
Posts: 1413
Joined: 02 Jul 2008, 13:23
Software used: Spike2
1401 type: Power1401 mk II
Location: Georgetown University, Washington DC, USA
Contact:

Re: Synchronize externally played video (in VLC player) with spike2

Unread postby Pawel Kusmierek » 21 Jul 2020, 13:59

There may be a clever software method, but the way people have been syncing video presentation to data acquisition is by placing a small white rectangle in otherwise black corner of the video only in selected frames. Then they place a photodiode or other detector over the corner of the screen and feed the output to the acquisition system (in this case, the 1401). And then you have perfect sync accounting not only for video start uncertainty but for software delays, monitor refresh rate etc.

Note that this should be done not just in the beginning of the experiment but periodically, as there may be a drift between video presentation timing and data acquisition timing.
Paweł Kuśmierek

Spike2 Power 1401 Mk II

User avatar
Tim Bergel
Site Admin
Posts: 2381
Joined: 19 Jun 2008, 14:40
Location: Cambridge, England
Contact:

Re: Synchronize externally played video (in VLC player) with spike2

Unread postby Tim Bergel » 22 Jul 2020, 10:18

Your other options depend upon the capabilities of the VLC player:

(1) when the video starts, spike2 starts recording

To do this requires that VLC generates a TTL pulse or other signal when it starts playing the video.

(2) while spike2 is recording and the video starts playing a marker is set automatically, and the optogenetic stimulation starts

To do this requires that VLC video output can be triggered by a TTL pulse generated by Spike2.

I don't know anything about VLC, a quick glance at the web site does not suggest that either of these are possible. Pawel's suggestion may well be the best way to go.
Tim Bergel Cambridge Electronic Design


Return to “General”

Who is online

Users browsing this forum: No registered users and 1 guest

cron