Video Streaming and Recording Setup

Organization: Project SCINI at Moss Landing Marine Labs
Date: December, 2007
Disclaimer:This material is based on work supported by the National Science Foundation under Grant No. ANT-0619622 (http://www.nsf.gov). Any opinions, findings and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the National Science Foundation.

Surface Setup

Follow this schematic to get all the computers plugged together correctly and power them all up:

Block Diagram of Surface Setup

Configure for Dual Monitor

After CREAM is booted into kubuntu linux (default boot), sometimes the monitor is not setup for the external LCD; this has to do with the X11 configuration file; /etc/X11/xorg.conf.default is single monitor, /etc/X11/xorg.conf.dual is for the large external LCD we used in the 2007 field season. To switch between the two, change the /etc/X11/xorg.conf link to point at the right file. Pull up a terminal and:

$ cd /etc/X11
$ sudo rm xorg.conf
$ sudo ln -s xorg.conf.dual xorg.conf

Hold Control+Alt and press Backspace (Not Delete) to restart X Windows; this will close all running GUI programs! Sometimes a crash window will pop up when in dual monitor mode, this can be ignored (press ok?).

Repeat this process using the xorg.conf.default file to return to single monitor operation (if you don't have the external screen on the bench?).

Playing Streaming Video

After X Windows is up and running with the correct monitor configuration and SCINI is powered up, we are ready to configure the Elphel camera. Bring up Firefox (there should be multiple icons on the desktop) and follow the cam2 link. Press "OK" on the dialog that pops up and the interface should pop up. This web interface annoyingly brings itself to the front while it is refreshing for the first 20 seconds. Make sure a photo frame from the camera is displayed, this indicates everything is running correctly. It will be blurry if SCINI is out of the water. Put this window on the laptop screen.

If at any time you get a cam.cgi error, you're going to fast for the interface and you will have to press F5 to refresh the interface.

Click on the camera icon to bring up the main settings window; click the "more options..." link to display binning settings. Select the 2048x1536 resolution to put us in 3 megapixel mode. Wait a few seconds, then select the horizontal resolution as 1/2 (vertical should auto-select); wait a few seconds then select 1/2 as the horizontal binning (vertical will auto-select).

Click "less options..." to hide these settings and adjust the exposure sliders just below. A sliver circle in the slider indicates that you have manual control, a black triangle indicates auto-exposure is in charge. Clicking the icon to the left of every slider switches auto mode. The top slider is exposure (star like icon); click on this to get manual control, and slide to 70.3 to start with. Get manual control of the brightness control (green star a few sliders down) and put that at about 3/4 of the way to the right. You will be playing with these controls and the lights as you drive and the lighting situation changes.

Now you are ready to start streaming; click on the yellow arrow icon at the top left hand corner (second from the left) and select the start streaming checkbox. You should see a green scroller start just below the yellow arrow icon. Swap back to the black camera icon for exposure control.

Now you're ready to view streaming video. Open a terminal on the big screen and run the cam2_play script in your home directory (where you start, it's actually at /home/scini):

$ ./cam2_play

An mplayer screen should pop up with the video; drag this over to the big screen if you need to. Double check that latency is decent. If the video is jerky or laggy even after about a minute (sometimes the web interface slows down the video when it first starts or exposure is adjusted), try putting mplayer in hardware acceleration mode: right click on the video screen, select "Preferences", go to the "Video" tab, and select the "xv" driver (as opposed to the "x11" driver), then restart the stream for the changes to go into effect.

Saving streaming video

Once you have moving video, you can save the stream with ElphelOgm.

First create a data directory to save the video to, changing scini_01jan2001 to an appropriate name:

$ cd /media/cream-data/
$ mkdir scini_01jan2001
$ cd scini_01jan2001
$ mkdir raw_video
$ cd raw_video

Now try running ElphelOgm in this same window; change the file 001 as appropriate:

$ ElphelOgm -a 232.0.0.1 -p 20000 > 001

You should see a reasonable frame rate scrolling by; 1000 fps means there's a problem. To stop at anytime hold Control and press c; pressing the up arrow brings up the previous command and you can rerun with an incremented file name. CAREFUL!

To monitor the files bring up a new terminal and:

$ cd /media/cream-data/scini_01jan2001/raw_video
$ watch -n 1 ls -lh