Skype: Video: Difference between revisions

From OLPC
Jump to navigation Jump to search
No edit summary
No edit summary
Line 10: Line 10:


* [[Skype|Install Skype]]
* [[Skype|Install Skype]]
* Obtain a compiled version of the gstfakevideo package for the OLPC (you need a script called gstfakevideo and a library called libgstfakevideo.so; see below for [[#Building gstfakevideo|details]])
* Obtain a compiled version of the gstfakevideo package for the OLPC (see [[#Building gstfakevideo|below for details]] to build or download it)
* Open a terminal window
* Open a terminal window
* Move /dev/video0 out of the way, e.g. (as root):
* Move /dev/video0 out of the way (as root):
su
su
mv /dev/video0 /dev/video1
mv /dev/video0 /dev/video1
* Edit the gstfakevideo script (e.g. vi gstfakevideo) and change the video pipeline by editing the 'export GST_PIPE=...' line to:
* Make sure the video pipeline is correct by editing the gstfakevideo script (e.g. vi gstfakevideo) and changing the 'export GST_PIPE=...' line to read:
export GST_PIPE="v4l2src device=/dev/video1 ! ffmpegcolorspace ! videoscale"
export GST_PIPE="v4l2src device=/dev/video1 ! ffmpegcolorspace ! videoscale"
* Make sure 'skype' is on your path
* Make sure 'skype' is on your path (which it will be if you installed correctly)
* Run the gstfakevideo script :
* Run the gstfakevideo script :
./gstfakevideo
./gstfakevideo
Line 24: Line 24:
At this point you should be able to use skype as normal, but video options are enabled, e.g. click the tiny camera icon once you start a chat to share your video, or modify the video preferences to start video automatically within calls (see [http://forum.skype.com/index.php?showforum=36 Skype Video forum]).
At this point you should be able to use skype as normal, but video options are enabled, e.g. click the tiny camera icon once you start a chat to share your video, or modify the video preferences to start video automatically within calls (see [http://forum.skype.com/index.php?showforum=36 Skype Video forum]).


==Comments==
==Discussion==


You can test the video pipeline independently of Skype by trying things like this at a terminal prompt:
You can test the video pipeline independently of Skype by trying things like this at a terminal prompt:

Revision as of 14:17, 11 January 2008

These instructions outline what I did to get (two-way) video chat working after installing Skype (Public Beta 2.0.0.27). After the basic Skype installation you should already be able to receive video chat; these instructions allow you to send video from the OLPCs camera to the person you're talking to.

I haven't used it extensively but did get a video chat working between an XO and a Mac, although part way through I lost sound - maybe something to do with bandwidth or CPU? If so maybe we could dial down the framerate or something? Hopefully others who know more about all this stuff can contribute their thoughts. (My head is only barely above water at this point given my very limited knowledge of linux, skype, gstreamer, etc.)

Based on a suggestion in one of the OLPC forums, I found some code called 'gstfakevideo' (aka skype video hijacker) which uses the open source gstreamer framework (coincidentally the XO's multimedia platform) to stream an arbitrary video source into Skype.

Installation

The basic recipe is:

  • Install Skype
  • Obtain a compiled version of the gstfakevideo package for the OLPC (see below for details to build or download it)
  • Open a terminal window
  • Move /dev/video0 out of the way (as root):
 su
 mv /dev/video0 /dev/video1
  • Make sure the video pipeline is correct by editing the gstfakevideo script (e.g. vi gstfakevideo) and changing the 'export GST_PIPE=...' line to read:
 export GST_PIPE="v4l2src device=/dev/video1 ! ffmpegcolorspace ! videoscale"
  • Make sure 'skype' is on your path (which it will be if you installed correctly)
  • Run the gstfakevideo script :
 ./gstfakevideo
  • This launches skype normally (after forcing skype to first load the libgstfakevideo.so library which uses the GST_PIPE setting to provide a fake skype-compatible video source at /dev/video0)

At this point you should be able to use skype as normal, but video options are enabled, e.g. click the tiny camera icon once you start a chat to share your video, or modify the video preferences to start video automatically within calls (see Skype Video forum).

Discussion

You can test the video pipeline independently of Skype by trying things like this at a terminal prompt:

 gst-launch videotestsrc \! ffmpegcolorspace \! videoscale \! autovideosink

This should create a test pattern on your XO display. (To quit, press the 'home' button and either stop the unnamed activity or return to terminal and press ctrl-C.) Note you need backslashes before the exclamation marks when executing directly in the terminal to escape them, but not in the gstfakevideo script itself. Also the 'autovideosink' element is only needed when testing (it routes the pipeline to your screen, instead of /dev/video0 for skype like the fakevideo library does).

To test your video camera, try a pipeline like this:

 gst-launch v4l2src device=/dev/video1 \! ffmpegcolorspace \! videoscale \! autovideosink

then you should see your own smiling visage. (Same instructions to quit.)

I'm not sure if you need to move /dev/video0 every time you boot the machine (probably?). It seems to be a requirement because the gstfakevideo library can only fake /dev/video0 (so you can't have your 'real' video source there). There is a setting in gstfakevideo to tell it what fake video device to provide but the doc says it doesn't work (I haven't actually tried).

A cleaner setup would probably be to install the gstfakevideo stuff alongside the skype install, and alias 'skype' to kick off the video stuff. But I haven't done that yet. It would also be good to sugarize the whole thing so you could kick off your video skype session from the toolbar. I might have a go at that if no one beats me to it.

Building gstfakevideo

I built the gstfakevideo library in a qemu image, since it required a bunch of dependencies that I didn't want to put on my XO:

 yum install subversion
 yum install make
 yum install gcc
 yum install gstreamer-devel

(and probably some others I forgot). Then I did:

 svn checkout http://gstfakevideo.googlecode.com/svn/trunk/ gstfakevideo
 cd gstfakevideo
 make

All this work simply creates the library libgstfakevideo.so which is only 14K in size. I've posted this on in one of the forums, so you might be able to download the zip file from: http://olpcnews.com/forum/index.php?action=dlattach;topic=471.0;attach=169 (requires registration?). I'd happily post it elsewhere if there's somewhere more sensible, or can provide by email. In my case I just copied the library on a USB stick onto the XO.