Streaming video from built-in webcam

(This should be cleaned up more as it is a useful thing to be able to do. I just tried it, and these instructions work on diablo (with no extra packages but gstreamer-tools from repository.maemo.org))
Line 5: Line 5:
This note describes how to stream video from the platform to an RTP sink, for example the [https://maemo.org/community/wiki/howtostreamvideo/ vlc] media player.
This note describes how to stream video from the platform to an RTP sink, for example the [https://maemo.org/community/wiki/howtostreamvideo/ vlc] media player.
-
# Install the necessary gstreamer packages. The following list may be excessive, but "works":
+
First, you must install the '''gstreamer-tools''' package from the diablo repo on repository.maemo.org.
-
#* gstreamer-tools  
+
 
-
#* gstreamer0.10-3gp-osso
+
-
#* gstreamer0.10-adpcm-osso
+
-
#* gstreamer0.10-ffmpeg-osso
+
-
#* gstreamer0.10-gnomevfs
+
-
#* gstreamer0.10-hantro
+
-
#* gstreamer0.10-id3lib-osso
+
-
#* gstreamer0.10-mpeg1demux-osso
+
-
#* gstreamer0.10-mpegstream-osso
+
-
#* gstreamer0.10-plugins-bad
+
-
#* gstreamer0.10-plugins-base
+
-
#* gstreamer0.10-plugins-base-extra
+
-
#* gstreamer0.10-plugins-base-kulve
+
-
#* gstreamer0.10-plugins-good
+
-
#* gstreamer0.10-plugins-good-extra
+
-
#* gstreamer0.10-plugins-good-kulve
+
-
#* gstreamer0.10-tools
+
-
#* gstreamer0.10-wma
+
# On the N800, the following script will stream video from the camera. Here, 172.31.0.244 is the Linux box with VLC installed, and 172.31.0.245 is the N800. I call this script <tt>~/bin/rtpstream.sh</tt>.<br/> <tt><nowiki>#!/bin/sh</nowiki></tt><br/>  
# On the N800, the following script will stream video from the camera. Here, 172.31.0.244 is the Linux box with VLC installed, and 172.31.0.245 is the N800. I call this script <tt>~/bin/rtpstream.sh</tt>.<br/> <tt><nowiki>#!/bin/sh</nowiki></tt><br/>  
<tt>VPORT=5434</tt><br/> <tt>APORT=5432</tt><br/> <tt>HOST=${1:-172.31.0.244}</tt><br/>  
<tt>VPORT=5434</tt><br/> <tt>APORT=5432</tt><br/> <tt>HOST=${1:-172.31.0.244}</tt><br/>  
Line 32: Line 15:
# Enjoy streaming video (and sound) from the N800.
# Enjoy streaming video (and sound) from the N800.
-
Thanks to [http://web.media.mit.edu/%7Elifton/snippets/n800_to_sl/ Josh Lifton] for the original leg work.
+
Thanks to [http://web.media.mit.edu/%7Elifton/snippets/n800_to_sl/ Josh Lifton] for the original leg wor
-
 
+
-
 
+
-
 
+
[[Category:Users]]
[[Category:Users]]
[[Category:Midgard wiki]]
[[Category:Midgard wiki]]

Revision as of 22:51, 28 September 2008

Image:Ambox_content.png
This is an article from the old midgard wiki that hasn't yet been fully updated for this wiki, please update it.
Please see the talk page for discussion.


It is possible to use the N800 camera as a source of streaming video. This was originally described here, but the referenced example has an error which prevents it 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 repository.maemo.org.

  1. On the N800, the following script will stream video from the camera. Here, 172.31.0.244 is the Linux box with VLC installed, and 172.31.0.245 is the N800. I call this script ~/bin/rtpstream.sh.
    #!/bin/sh

VPORT=5434
APORT=5432
HOST=${1:-172.31.0.244}
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

  1. 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
    v=0
    o=- 37 614155991 IN IP4 127.0.0.0
    s=QuickTime
    t=0 0
    a=range:npt=now-
    m=audio 5432 RTP/AVP 0
    c=IN IP4 172.31.0.245
    b=AS:63
    m=video 5434 RTP/AVP 96
    c=IN IP4 172.31.0.245
    a=rtpmap:96 H263-2000/90000
    a=fmtp:96
    a=cliprect:0,0,144,176
    a=framesize:96 176-144
  2. On the N800, pop out the camera and run:
    $ ~/bin/rtpstream.sh # assume on PATH, +x etc.
  3. On Linux box (note VLC runs on other platforms as well):
    $ vlc /tmp/n800.sdp
  4. Enjoy streaming video (and sound) from the N800.

Thanks to Josh Lifton for the original leg wor