menu Contact Us Dizzy Patients Health Care Providers Dizzy Culture Research Site DVD BPPV DVD Tai Chi DVD Understanding Dizziness Acknowledgements Disclaimer Quoting

Digital Video Recorders and Eye Movements

How I do it.

Timothy C. Hain, MD Page last modified: May 30, 2011

Computers and multimedia have made a huge impact in the world at large, and also in the oculomotor laboratory. It is possible to use readily available equipment to record video eye movements and public domain "free" programs to create movies out of your recordings. Herein I have outlined the how to do this.

Micromedical Technology monocular eye movement recording apparatus (Visual Eyes) Location of seondary camera -- a Panasonic security type camera.

Hardware

You should expect to spend about $4000 on your entire setup, almost all of it on the Micromedical goggle.  You should expect to spend several hours ordering these parts, and another hour to hook them all up.

Device

Cost (roughly)

Real-eyes goggle (Micromedical Tech) 2500
PIP processor (see below) -- these are needed but fortunately cheap. 150
Room CCTV camera, and mounting mechanism. wv-bp144 and mount. Doesn't matter much -- best to get one that adapts to light automatically. Don't forget to get cable (BNC), lens, and 12 volt power supply too. 200
Large monitor with Composite input (17" LCD, or CC-TV monitor) $400 (big and "industrial strength" is good).
Panasonic DVR DMR-EZ28K, cabling (various phono or BNC adaptors). $225, 100$
CE-labs audio and video amplifier, model 400 $40. (optional)

Video Input: I use a Micromedical Technology "Real-Eyes" system. This is a single camera set in a Scuba goggle. It is monocular, with a normal, "NTS" video output. At this writing, my advise is don't get the version with firewire output (although it MIGHT work with this particular DVR, which does have firewire input).

The other eye can be allowed to view or not, as the examiner desires. See this page for more comments.

We currently use the AMBERY 4 channel PIP processor (costs about $150) . The PIP box combines video from another camera that views the room, so that there is an inset on the eye of the examiner and examinee. This makes the entire editing process much easier. Generally about all you can tell from the PIP is the gender of the patient, their hair color, and what is being done. This is a good situation.

The current video camera that we use is a Panasonic WV-BP144. This camera is no longer made, and we are replacing it with LX-620SHW High Resolution Sony CCD CCTV Security Camera - 1/3 540 Lines.

The camera must be mounted and angled properly -- many camera stores sell appropriate devices for between $20 and $100.  We use a rather fancy one (Bogen something or another). It isn't very good because it is not mechanically very stable.  Suggest finding a different mount.

 

Electrically,  the way this works is that the two cameras go to the PIP. The PIP goes to the DVR, and the DVR goes to the monitor. 

If you have the extra parts and cables, you can also set it up so that you also send the eyeball camera to the monitor 2nd input, so when you record you just see the eye, but when you play back, you see eye and what you were doing in the inset.

The output of the PIP processor goes into a distribution amplifier (unnecessary in reality), and then a Panasonic DVR recorder (see above). Then the output of the DVR goes to a very large TV monitor. The audio signal from the goggles also goes to the DVD recorder.

The Panasonic DVR is a very handy device that writes a new title to the DVD for each patient. I currently have a Panasonic EX17.  The EZ28 is the current equivalent.

I have also tried a Sony brand DVR, but I much prefer the Panasonic. The Sony is much touchier with what type of video it will accept, and strangely enough, writes files that cannot be copied (easily). I guess Sony, in their zeal to prevent pirating, decided that their customers should not even be able to copy their own content ! Recall, Sony is the company that put a rootkit on their customer's music CD's !

Panasonic's DVR works fine and you don't have to fight with the Sony content management system to read your own material.   A nice feature of the Panasonic is that after you record your 20 or so patient files, when you push the eject button, it offers to burn your final DVD. This is handy.  The remote is also very handy -- as you can do everything from afar.

The Panasonic EZ17 recorder has a firewire input -- but it is useless. Seems to be a software problem.  A recorder that really does DV might be worth it, but not sure where to get one.

The CE-labs audio/video amplifier (optional) isolates your DVR-recorder and monitor from each other.  This is not necessary with the Panasonic DVR as everything you put into it can go right to your monitor, but might be useful for other situations. It is nice to be able to switch from full screen input to PIP mode on playback.

Typically each patient consumes about 5 minutes of the DVD. Usually one can get by with one DVD/week, but on very busy weeks, or days where one forgets to stop recording after a patient, sometimes it takes two. This costs you about $1.00 in media costs. I use Ritek 8X DVD+ disks.  It is not very touchy about media.

At the start of each patient, I scan the camera over the patient's demographic information. This is to allow me to match up patients with video's later.

A days worth of patients might thus include about 8 to 12 titles (patients). At the end of each week, or when I forget to turn the recorder off (still do this after years), I "finalize" the DVD, write the date on it with a sharpie, and stick it in a drawer. Finalization takes about 1 minute.

Extraction of video content

At this point, you will have a DVD that you can play, but it will contain a lot of junk -- most recordings won't have anything worth preserving for posterity.    If you want to give a talk and show that really neat case from last week, this is what you do next.

Index your DVD

Take the DVD, combine it with your schedule, match up the title numbers to the patient names. You can use any DVD player to do this -- a hardware one or a software one. I have used Nero Showtime. Others work as well so there is no need to buy this program. Close your DVD viewer.

Extract the title you want -- using dvd-decryptor

Next, you need to extract the title(s) that you want. This is much harder than it should be, and I believe that the reason for this is that the movie industry is attempting to discourage piracy. Applications like this are innocent bystanders.

Anyway, the only way to do this that I have been able to get to work is to use DVD-Decrypter, which is an awesome free piece of software which can be found on the net. Most people use it to copy CSS encoded DVD's -- but we don't need to do this because our Panasonic DVD's are not CSS encoded. I am not sure what Sony is doing -- but you should stay away from them anyway given their aggressive approach. DVD decrypter will decrypt Sony DVR written DVD's anyway if you are stuck with it or something like it.

Run DVD-Decrypter in IFO mode (which is the default). Choose the title (PGC on the menu of things on the right) that you want to extract, and the chapter that matches up with the DVD menu, and let DVD-Decryptor do it's thing. This will take several minutes for about 5 minutes of video, perhaps faster if your computer is better than mine.

This will get you a directory which will have at least one "VOB" file in it. This file contains your video "title", basically a chapter from the DVD that you started with, which contains one patient.

Convert the VOB file into a usable format -- using either virtualdubmod or dgmpgdec

What you want out of this whole process is an avi or mov file, edited so that it is small enough to be played in your powerpoint presentation or web or whatever. A VOB file is not what you want. So you need an application that will read and convert VOB files.

Again, commercial programs seem not to do this very well if at all.

At this writing, this method works pretty well:

You will need some additional freeware video editing programs:

  1. virtualdub-mod
  2. avisynth 2.5
  3. virtualdub
  4. dgmpgdec (an alternative to virtualdubmod)

Yes, this is a bit strange -- using two different versions of "virtualdub". At least they are both free. Anyway, virtualdbub-mod reads the MPEG format VOB files produced by dvd decripter, and can save it as an avi file.

Compressed vs. uncompressed:

These are big files. The default is for virtualdubmod to save it "uncompressed". This is not usable for presentations because the file is too big. However, it is a good idea if you are planning to do more editing. If you save the output from virtualdubmod as an uncompressed avi file, it is best to select out the piece you want, and just save that rather than a long stretch (like 5 min). Practically, about the most you can easily deal with is 1 minute.

Allternatively, you can select out the piece you want, compress it, and you are done. We suggest using a very old codec, such as the "Cinepak codec by Radius", rather than something newer, as while files may be a little bigger, they will run on nearly any computer. You are taking your chances if you use a newer codec. It may work on your PC, but not run off of anything else. This is the big problem with all of these "codecs". Any type of compression is going to take a lot longer (but use much less space) than uncompressed.

Making it prettier

Assuming that you want to make it prettier, once you get the video out of the MPEG format into an avi format, you can manipulate it -- clip it, title it, with the combination of avisynth and virtualdub. If all you want to do is to just show it as a clip, you don't need to do anything other than recompress it.

The way this works is that you create a small "avs" file, and open this up with virtualdub. Virtualdubmod doesn't seem to do this as well.

An example of an avs file is :


ShowSMPTE(x=600, text_color=$ffffff, size=32) # elapsed time stamp
-- we think this is generally a very good idea. Can use smaller size.
SelectEvery(2,1) # decimate to 15 fps # reduce frame rate -- don't do this for saccadic nystagmus
Subtitle("Posterior canal BPPV", text_color=$FFFFFF, size=32) # use your own title
Subtitle("Copyright Timothy C. Hain, M.D. 2006",text_color=$FFFFFF, size=28, align=1) # use your own nameReduceBy2 # pretty small -- don't do this if you need high resolution. Makes a big difference in size.

Another way to do this is to use dgmpgdec

First, you run dgindex to convert out of the mpeg format.

This gets you an uncompressed video and audio stream. Then you use virtualdub, with an avs file something like this:

LoadPlugin("C:\Program Files (x86)\dgmpgdec\DGDecode.dll")
MPEG2Source("VIDEO_TS\vts_01_1.d2v") # serves AVI frames from MPEG source
# To get audio, you need to add an audio stream using virtual dub mod

ReduceBy2 # pretty small

ShowSMPTE(x=220, text_color=$ffffff, size=10) # Elapsed timer
SelectEvery(2,1) # decimate to 15 fps

Subtitle("Meniere's -- wrong way nystagmus", text_color=$FFFFFF, size=20)
Subtitle("Copyright Timothy C. Hain, M.D. 2011",text_color=$FFFFFF, size=10, align=1)

 

Virtualdub allows you to cut what you want and save it as an avi file. Virtualdub is pretty crude with the subtitles, but it is very fast. Usually crude and fast is fine for a 10-60 second video.  The "filters" in Virtualdub will do almost everything but subtitles and showSMPTE - -in other words, you can reduce by 2 and select every other within virtualdub, rather than on in the AVS file.

At this point, you have an avi file that is generally pretty small, and suitable for use in your powerpoint or on the web.

References:

  1. http://www.avisynth.org/
  2. http://www.virtualdub.org/index

Dvddecrypter was bought by Macrovision Europe who announced that it's distribution is illegal. (boo). Copies can be easily located on the internet though, and as this use is entirely legal, it is difficult to see how anyone would object.

 

© Copyright November 30, 2011 , Timothy C. Hain, M.D. All rights reserved. Last saved on November 30, 2011