If you own an Asus EEE PC or another machine running Ubuntu and a camera which is only supported under Video4Linux 2 (V4L2) you will have noticed that it not possible to get your camera to work under Flash. This will hopefully change soon, with V4L2 support in Flash 10. However, as Flash 10 is still a release candidate you might find that you still have problems when using a V4L2 camera. I've seen this on websites that switch the camera off and on again during one Flash session, this seems to not work very well. There is another way to get the camera working under Flash though, the Flashcam project which gets around the lack of support for V4L2 webcams by forwarding the output of the camera to a simulation of device that uses Video4Linux 1, which is supported under Flash 9.
Interestingly, I found out about Flashcam during a discussion on how to get Seesmic to work on the Asus EEE PC, I posted a method to get this to work under Flash 10, but it turned out this did not work on an EEE with Xandros installed. Seesmic have a section for their site on getsatisfaction.com, a website that aims to bring organisations and their customers together to improve products, and it was there that Flashcam came up as a potential solution to this problem.While working on a problem with Trevor Collins we noticed that Flash 10 could not cope with the camera being turned off an on again, meaning that it was not possible to use the EEE with the OU's Flashmeeting, so we tried out Flashcam as had been suggested and it worked very well! We were able to use the EEE with this web based video conferencing and collaboration tool - an exciting prospect.
The installation instructions for Flashcam are quite general, and I felt it was best to tweak them a little bit for Ubuntu (doing things the Debian way!). Firstly we want to make sure that the minimum requirements are satisfied, then we want to install it in such a way that we can still use Synaptic to uninstall it, as we would for other software. As an added bonus, at the end of this process we will end up with a package which can be installed on other Ubuntu machines (of the same architecture) without the need to recompile.
Flashcam lists the minimum requirements as follows:
- Kernel 2.6.11
- Kernel headers needed
- Kernel compiled with CONFIG_VIDEO_V4L1_COMPAT
- Dev tools (gcc, make, etc).
- System with udev running
The first requirement should be satisfied on Ubuntu 8.04, if you want to check run the command: uname -r this will tell you what version of the Kernel you are running. You'll need to make sure now that the package containing the Kernel headers is installed, this will enable us to compile code that will add to the functionality provided by the Kernel. If you are using Ubuntu EEE you will find that the Kernel headers are probably already installed. To check if this is installed search for "linux-headers" in Synaptic or type: dpkg -l linux-headers-* in a shell. If you see "ii" in the leftmost column then it is installed. If not find out what version of the headers correspond to your kernel and install them. So if you type uname -r and see something like: "linux [hostname] 2.6.21-16-generic" you will need to install the linux-headers-generic package (with sudo apt-get install linux-headers-generic). For the third requirement I found that no action was needed, the option was already there. The requirement for development tools (4th on the list) can be satisfied by installing the build-essential package. The udev system, which helps the configuration of hardware when it is added to the system, is already installed on Ubuntu systems. For the method here I am going to add one last requirement, to add the checkinstall package, this will enable us to build a precompiled binary package later on.
Download flashcam to a directory on your computer and untar (extract the files from) it with:
tar xvzf flashcam-1.1.tgz
Go into the new subdirectory that has been made and we need to make one small change to the file named: Makefile. I found that I needed to comment out a line to prevent some error messages during installation. At around line 43 there is a line which begins with: "if [ -x /usr/sbin/update-rc.d ]; then ..." comment this out by adding a '#' at the beginning of this line. Close the file. We can now compile the source code by typing make, but don't do as the Flashcam instructions say and type make install afterwards. Instead we can use a rather clever program named Checkinstall to intercept this step then build and install a package for us. This gives us the advantage that we can remove the software at a later date through Synaptic just as we would any other package. It also means that if we wanted to use the same program on another Ubuntu machine we can just copy over the package file and install that, we don't have to install development tools and reinstall on that machine. So type:
sudo checkinstall
This command is interactive so you will get asked a few questions on the way. The first is to as you if you wish to create a default documentation set, answer yes to this. Now you will be asked for a description of the package, this is worth entering so when you look at the package using Synaptic or a similar tool in the future you will be given enough information to remind you what the software was for. You could enter something like "Flashcam aims to get your V4L2 webcam driver working with Adobe Flash", you could also add any extra information that you feel would help you in the future. Press return on an empty line to finish the description. After this checkinstall will have pretty much everything that it needs to build the package, you will be presented with the details that checkinstall will use as the metadata for the package and you will see a screen that looks something like this:
The defaults should be just fine, but if you are planning to deploy the package on multiple machines you should change the maintainer field (option 0) to your own contact details so the users of these machines can contact you in case of query. Now press enter and checkinstall will perform the steps required by Flashcam for its installation, build a package and install it. It will also leave a copy in the current directory so you can use it elsewhere.
To use Flashcam you first need to load the drivers to create a loopback device that will appear to Flash as a V4L1 camera. Do this with the command:
sudo flashcam -L
All being well you will see a message saying it has found your camera and it has loaded the kernel module required. To use flashcam you simply type:
flashcam
You will see it use default options to create a fake V4L1 device, you can fine tune Flashcam to your requirements by changing options that can be seen with:
flashcam --help
The next time you visit a Flash site you should be able to change the Flash settings to use Flashcam. I've found this a good way to use the webcam on the EEE under Flash, hopefully Flash 10 will get through its remaining bugs and render all of this unnecessary, but for now Flashcam is a very useful utility. This also shows a good use case for Checkinstall. This is a great way to use software that is not yet available in a packaged form and turn it into packages that can be easily used, reused and uninstalled. This is particularly useful in cases where the source code provided contains no provision for uninstalling the program, which is not the case for Flashcam, but is sometimes the case for other software. It won't work in all cases though. Further information on Checkinstall can also be found on the Ubuntu Wiki at: https://help.ubuntu.com/community/CheckInstall.
For me had finished with this
For me had finished with this error : linux/videodev.h: No such file or directory