luvcview for fun and for profit
(I’m moving random Linux stuff from my private journal to here, it’s a bit chaotic at present, but bear with me. And yes, there will be artwork, I know everyone wants the artwork and not random juicy bits of Linux!
)
This entry is about using luvcview under Linux for some very simplistic video recording for your eye tracker, or any other purpose. I discovered these things while I was trying to set up the visible spectrum Starburst algorithm, but after trying out several algorithms I decided to use a different one… so I don’t know if these will be of any use to anyone! Still, here goes.
Once you’ve bought a webcam (which will be the subject of a different post) you can test it out using luvcview, a very simple video app. (Remember, you want to test with something simple, and if it works, you can move on to something more complicated.) This little Linux app is even suited to recording two concurrent video streams for your eyetracker, try this:
luvcview -d /dev/video1 -i 30 -o videoA.avi
luvcview -d /dev/video0 -i 30 -o videoB.avi
luvcview saves config with F1, loads with F2! To say this is underdocumented is an understatement – it’s not in the help or any of the obvious places, it took me half an hour to find it.
Here is a sample config file. I confess I have no idea where I found it – Google only brings me up the source code for luvcview.
id value # luvcview control settings configuration file
9963776 128 # name:Brightness type:1 min:0 max:255 step:1 def:128
9963777 32 # name:Contrast type:1 min:0 max:255 step:1 def:32
9963778 32 # name:Saturation type:1 min:0 max:255 step:1 def:32
9963788 1 # name:White Balance Temperature, Auto type:2 min:0 max:1 step:1 def:1
9963795 255 # name:Gain type:1 min:0 max:255 step:1 def:0
Unfortunately there is no way (that I could find) to save exposure settings in luvcview. This is really annoying, because one of the webcams I used required the exposure to be set to a nonstandard setting to capture at 30 fps.
I tried and tried and tried to get two streams to start recording at the very same time (either with luvcview or something more complicated) and I couldn’t find a good solution – I wasted a whole day with this, but then I realized Joel Clemens who made the Windows version of Starburst couldn’t find one either:
- While recording your eye tracking videos, be sure to flash the user with a camera flash or equivalent strobe to allow a spot where you can see where to sync the videos. (this is because it is not reasonable to assume that we can start recording from the 2 cameras at exactly the same time)
So I was a bit relieved
His solution worked very well for me in practice. I simply used my cell phone camera to produce a flash, and then found the first frame and cut both video streams there. (I haven’t tried his Windows port of Starburst because I only have Matlab for Linux – but I have to say his documentation was very useful even for the Linux version!)
Simply using the camera flash method and luvcview to record two streams produces two nice streams which can be input to Starburst… but Starburst will be the subject of a separate post, IY”H.
No Comments »
RSS feed for comments on this post. TrackBack URL




