Skip to content

Video frame grabber plugin for the open-ephys plugin GUI

Notifications You must be signed in to change notification settings

dsdanielko/FrameGrabberPlugin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

FrameGrabber

A simple video4linux2-based video frame grabber plugin for the open-ephys plugin-GUI. It retrieves frames from any device supported by v4l2 and displays them using opencv. Moreover, frames can be saved to disk (in jpg format) together with open-ephys hardware time stamps making it easy to synchronize frames and recorded data later on. Depending on your camera this approach should be useful for most (behavioral) tracking experiments. In case the experiment requires very precise time stamps, e.g., high-speed whisker tracking, it might be a good idea to use a camera that can send TTL pulses for each frame.

Currently, the plugin only runs under Linux. However, contributions to make it also run under Windows (e.g., using directshow) are highly welcome.

What should work:

  • capturing frames from any v4l2 supported camera (using mmap; pixel formats: YUYV, MJPG)
  • saving frames in jpeg format; the file name format is "frame_{frame_index}_{experiment_number}_{recording_number}.jpg"
  • saving frame index, experiment number, recording number, and hardware/software time stamps to a separate csv file to make post-processing easier
  • basic controls via ui (image quality, color, recording mode, frame counter resetting, frame directory name)
  • saving/loading parameters

To-do:

  • add further video APIs, e.g., directshow
  • python/matlab functions to read frames and timestamps (including optional interpolation)

Dependencies

This plugin requires the following libraries

  • video4linux2 (i.e. libv4l-0 and libv4l-dev under Ubuntu and Linux Mint)
  • opencv (version 2.4.x; core, dev, and highgui packages)

Installation

Copy the FrameGrabber folder to the plugin folder of your GUI. Then build the all plugins as described in the wiki.

Important It seems that there is a data type clash between JUCE and opencv. In my case, I had to replace all "int64" by "juce::int64" in CoreServices.h, CoreServices.cpp, GenericProcessor.h, and GenericProcessor.cpp. Note that this does not affect the rest of the GUI as it is using the juce namespace anyway.

Changing camera parameters

The v4l2 library comes with some tools that can be used to control camera parameters. The easiest way to see all available v4l2 controls is to use the v4l2-ctl tool from cmdline:

v4l2-ctl --all

An alternative is to use guvcview.

About

Video frame grabber plugin for the open-ephys plugin GUI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 98.1%
  • Makefile 1.9%