Video Annotation Revisited

We have some students doing a term project using the SMI eye tracking glasses. They need to manually annotate the eye tracking data and stimuli but we have more students than SMI BeGaze software, so we tried out some of the annotation tools I’ve mentioned previously. Unfortunately, recently while demoing the RIT Code app to some students it seems that with movies using newer codecs the application is painfully slow when trying to move thru video frames. While the software works well with older codecs (e.g. mpeg-2) – It seems to be showing it’s age as it was created 10+ years ago with the older quicktime framework – Will need to look into seeing if it can be updated. In the meantime one of the students found Anvil Video Annotation Tool

Video codecs and cross platform/application compatibility can drive you nuts – I messed around way too much today to actually get Anvil to work. The problem being it has a very particular list of ‘older’ codecs it supports. I am not sure how well maintained the software is as the links to their demo movies to test Anvil out had broken links.  I have movies from an SMI tracker which are xvid codec in an .avi container which is not supported by Anvil. To get something Anvil compatible I tried a few things out and the best I could find (after trying virtual dub, mpeg streamclip, handbrake, and looking at ffmpeg (but running into some problems wirth each.

Ultimately, I found that a combo of handbrake (which can open these avis but doesn’t support old codecs) and mpeg streamclip (which can’t open the avis but supports the old formats) will work.

Make sure to install handbrake: and mpeg streamclip:

First use handbrake to open the SMI tracker avi’s and convert to a .mp4 format with video encoder chosen as h.264 and framerate chosen as same as source.

Now you should be able to open this new video in mpeg streamclip. If you choose file->export as quicktime -and then choose the compression in the dropdown box. H.261 and H.263 work, but you can also try the others listed here:

Only problem is mpeg streamclip converts to these formats really slow (seems like it takes the same length as the video, so a 10 minute video is a 10 minute wait at least on my 2014 macbook pro) so it might be good to try alternates for better speed/quality as ymmv from mine.

Video Annotation Tool

I’ve mentioned in a prior post that Jeff Pelz’s group has a handy tool (note only for Macs) that allows you do frame-by-frame manual analysis that is common in mobile eye tracking experiments. I was showing the program to some students recently and realized that the sourceforge page does not have a compiled version and some of the quirks aren’t well explained. Here is a compiled copy with source code. Note the program expects video formats that can be opened via quicktime and must end in .mov (I find handbrake helpful for video conversion), also the labels.txt file must be on your desktop to have your predefined shortcuts. Otherwise the program is like a video player where you can easily mark time codes and milliseconds into a text editor and then save to a text file

Choosing Python Package Distributions

I recently updated an old post on using Tobii trackers with PsychoPy as I’ve started digging into python again.  Since that last post things have changed a bit on the scene. If you are new to python you typically have the option of download python, and individually installing libraries as needed manually or via a package manager. Because there can be many headaches with this approach for the unfamiliar, there have been 3 popular ways to provide users with a complete all-in-one python package (e.g. python command console, popular libraries, and an IDE).  Three popular ones include Enthought, Python(x,y), and Anaconda. Previously, I have recommended Python(x,y), and still do as it’s quite useful. That being said I was looking into IPython’s website recently to see that their recommended setup for the most recent version of their interactive command line is via Anaconda and I’m trying it out for the time being. Python(x,y,) as of this post has not been updated in over a year, whereas Anaconda appears to be growing in popularity as well as provides 32-bit & 64-bit and Python 2.7 & 3.5 versions. While quite similar in many ways (similar libraries, both provide Spyder & IPython) it appears Anaconda may be the way to go (at least when you want something quick, pre-packaged and intended to avoid the depths of dependency hell)

Open Eye Tracking API

Many labs have multiple eye trackers across brands, or would like to share code with colleagues in other labs with their own trackers. A common occurrence is that your code needs to be rewritten & compiled to use a tracker specific API/SDK. I recently became a member of COGAIN’s Eye Data Quality group and was informed about Oleg Špakov’s related project Eye-Tracking Universal Driver. His lab is working to make eye tracking software development easier by providing an API that supports multiple trackers, so code is written once and the API handles the details with the particular tracker. Something similar is implemented in PsychoPy, but I believe only supports SR Research, Tobii & SMI trackers, whereas ETUD supports more manufacturers and is accessed as a COM object so it should be supported by most programming languages.

Lateral Inhibition – Christmas Edition

Examples of the classic lateral inhibition effect pop up every so often in the real world.  In fact on my macbook laptop you can actually get this effect quite clearly by looking at the keyboard (black keys against the aluminum grid).  I happened to being looking into some online X-mas shopping and noticed Fjällräven has a plaid shirt that induces a very strong effect as seen here, the black dots popping in & out when you saccade are kind of like reverse christmas lights twinkling! Happy Holidays! God Jul!



Lack of clarity in Matlab

An odd bug (or lack of feature?) I found with Matlab results in a error messages that are largely unhelpful to track down why your code isn’t running. I had this happen a few months ago and solved it but then completely forgot again when it happened again today, so hope this helps.

I was running a program needing to use resample.m part of Mathwork’s own code. Running resample.m with proper inputs got back the message:

>Undefined function 'resample' for input arguments of type 'double'.

That’s strange. If you type exist(‘resample’) it comes saying it does in fact exist. If you type edit resample.m you get a file to come up…what’s going on?! Doing a file search also reveals that matlab toolboxes have at least 6 different copies of a file called resample.m (another confusion, but that’s another story). This seems really strange! Another useful function is which, to track down the path matlab is using when invoking a function. And here we get:

> which resample
C:\Program Files\MATLAB\R2015a\toolbox\signal\signal\resample.m % Has no license

I’m on a network license of matlab sharing with coworkers! So there you have it, we exceeded our number of seats. Totally baffling though when you first try to diagnose. Mathworks really should have a way to give a nice verbose error about when you try to use files that do indeed exist but have no valid license so can’t be executed.

See Also: