Giter VIP home page Giter VIP logo

framegrabberplugin's Introduction

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.

framegrabberplugin's People

Contributors

arnefmeyer avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.