Currently I am developing an application to encode webcam video stream directly to Ogg Theora. During my search I found some interesting projects and documentation.
The first one is the linpvr (Linux personal video recorder), this is an interesting project, but it is unfinished, then don’t wait to get it working, but it can be used as example to know how to convert RBG to YUV and to convert YUV to Theora:
Other useful project is Etheora, this is a set of API developed to simplify Theora usage, it have many conversion routines (RGBxyz -> YUV420, etc):
I am planing to use a webcam which supports natively YUV420 since this is the input format used on Theora encoding routines. Using VIDIOC_ENUM_FMT we can list what format the webcam and its kernel driver supports.
There is a program developed to test cameras supported natively by Adobe Flash, you can use this sample code to list your webcam capabilities:
In that post’s comments we can find a great listing of webcams and their supported formats.