VideoThru Lab

This is a lab exercise that is being offered at ICASSP 2011 in Prague. In this lab you will inspect, compile and run code that uses Video 4 Linux 2 (v4l2) to input live video from a web cam and displays it on the Display SubSystem (DSS).

Compiling the code
Here are the steps to take:


 * Open a terminal window. Application:Accessories:Terminal
 * In the terminal:
 * 1) cd VideoThru
 * ls

The VideoThru directory contains labs I've used to teach video on the Beagle.
 * 1) osd_setup shows how to write to a frame buffer.
 * 2) video_record shows how to capture video and store it in a file.
 * 3) video_playback takes raw video from a file and play it.
 * 4) video_loopthru has the students combine the first two labs to do real-time video io.

We only have time for one lab, so do the last one. main.c gets everything going, but video_thread.c is where the action is. It calls the routines that open the video input and sets up the frame buffer. Take a look at it.
 * 1) cd lab07d_video_loopthru/app
 * ls
 * 1) gedit *.c showOSD

Running
You need to run showODS before running the video apps. This makes the video frame buffer visible and sets the transparency. Take a look at it before running it. You can reset the screen by running resetOSD.

Be sure to have a web cam plugged in. It will run until you hit ctrl-C. Once you are sure it is working, try building everything from scratch. By default make creates a 'DEBUG' version of the app.
 * 1) ./showOSD
 * 2) ./videoThru_DEBUG.Beagle
 * 3) ./resetOSD
 * 1) make clean
 * 2) make

Experiment with the code
Now that you have something working, play around a bit. git is installed so you can preserve the present contents of the files with: If needed you can use git to retrieve the original version of the files.
 * 1) git init
 * 2) git add Makefile *.c *.h showOSD resetOSD
 * 3) git commit -m "Initial commit"

Here are some things to try:
 * There is some code commented out that draws to the frame buffer. Uncomment out the code and try running it.  Try changing the color or shape.
 * Modify showOSD to change the location of the video on the screen. Change the transparency.  Change the size and aspect ratio.
 * Here's an extra challenge, using the overlay managers, get the video to appear in two locations on the screen.

Call the instructors over when you have something interesting.