Streaming video from built-in webcam

It is possible to use the N800 and N900 camera as a source of streaming video.


[edit] N800

This was originally described here, but the referenced example has an error which prevents it from working.

This note describes how to stream video from the platform to an RTP sink, for example the VLC media player.

First, you must install the gstreamer-tools package from the diablo repo on

  • On the N800, the following script will stream video from the camera. Here, is the Linux box with VLC installed, and is the N800. I call this script ~/bin/
gst-launch-0.10 v4l2src ! video/x-raw-yuv,width=176,height=144,framerate=\(fraction\)15/1 ! hantro4200enc stream-type=1 profile-and-level=1001 ! video/x-h263,framerate=\(fraction\)15/1 ! rtph263ppay mtu=1438 ! udpsink host=$HOST port=$VPORT dsppcmsrc ! queue ! audio/x-raw-int,channels=1,rate=8000 ! mulawenc ! rtppcmupay mtu=1438 ! udpsink host=$HOST port=$APORT
  • On the Linux box, the sample .sdp file from the original article, with the address of our VLC player, saved as a file i.e. /tmp/n800.sdp
o=- 37 614155991 IN IP4
t=0 0
m=audio 5432 RTP/AVP 0
c=IN IP4
m=video 5434 RTP/AVP 96
c=IN IP4
a=rtpmap:96 H263-2000/90000
a=framesize:96 176-144
  • On the N800, pop out the camera and run:
$ ~/bin/ 

assume on PATH, +x etc.

  • On Linux box (note VLC runs on other platforms as well):
$ vlc /tmp/n800.sdp
  • Enjoy streaming video (and sound) from the N800.

Thanks to Josh Lifton for the original leg wor

On a N800, to make the image vertically flip automatically when the camera's pointing backwards (so it's not upside-down), change the source name from "v4l2src" to "gconfv4l2src".

To adjust the video encoding quality, have a look at the parameters described by entering "gst-inspect hantro4200enc" at a shell prompt. Setting the "bit-rate" parameter to its maximum (515) and the "profile-and-level" parameter to 1007 produces a much better quality image. Also, I suspect the "stream-type" parameter should be "5" (H263), not "1" (MPEG4 Video).

[edit] N900

The instructions for the N900 are very similar to the N800. First install gstreamer-tools.

$ apt-get install gstreamer-tools

Note: on PC you might need to replace gst-launch by gst-launch-0.10 in the examples below

To access the back camera use:
for the front

In the example below the IP for the two devices are as follows

  • PC IP
  • N900 IP

On the N900 the command you want to run is:

$ gst-launch v4l2src device=/dev/video0 ! videoscale! video/x-raw-yuv,width=320,height=240 ! ffmpegcolorspace ! jpegenc ! tcpserversink host= port=5000

On the PC run

$ gst-launch tcpclientsrc host= port=5000  ! jpegdec ! autovideosink

The below also works

$ gst-launch v4l2camsrc device=/dev/video0 ! videoscale! video/x-raw-yuv,width=320,height=240 ! ffmpegcolorspace ! jpegenc ! tcpserversink host= port=5000

Another example using a different encoder/decoder and udp

$ gst-launch v4l2src device=/dev/video0 ! videoscale ! video/x-raw-yuv,width=320,height=240 ! ffmpegcolorspace ! smokeenc ! udpsink host= port=5000


$ gst-launch udpsrc port=5000 ! smokedec ! autovideosink

Another example using omap3cam driver

$ gst-launch-0.10 v4l2camsrc device=/dev/video0 driver-name=omap3cam ! videoscale ! video/x-raw-yuv,width=320,height=240 ! ffmpegcolorspace ! jpegenc ! tcpserversink host= port=5000


$ gst-launch tcpclientsrc host= port=5000  ! jpegdec ! autovideosink

There are many ways to skin this particular cat. Recommendations are to look at gstreamer and familiarise yourself.

To stream from the N900 to VLC follow these instructions

[edit] For the future

[edit] vloopback

[edit] Webcam threads

[edit] Flumotion mention extras-devel

[edit] Streaming over ssh N900

Here is an alternative way of streaming video on the N900 over ssh.

First get ssh to do X11 forwarding by installing xauth as follows:

  1. Install libxmuu1 (needed by xauth) by "apt-get install libxmuu1"
  2. Install the xauth from

Now ssh to your N900 with the flag "-X" and then give the command:

 gst-launch-0.10 v4l2src \
 ! videoscale ! video/x-raw-yuv,width=320,height=240 \
 ! xvimagesink

A 320x240 video window should now popup on your desktop.