Streaming Live Audio and Video from a Nokia N800 to Second Life
22 April 2007 | |
| |
IntroductionThis document describes how to stream live audio and video from a Nokia N800 Internet Tablet into the Second Life virtual world. The N800 has a built-in microphone, web camera, and 802.11 wireless connectivity and comes with a video VOIP client preinstalled. The Second Life client can view any QuickTime compatible audio and video stream. Combining the two is fairly straightforward and just a matter of determining which piece connects to what; no code needs to be written or even compiled. The basic idea is to use GStreamer on the N800 to encode live audio and video and transmit the streams via RTP to a QuickTime Streaming Server, which then reflects it as an RTSP stream to any interested clients, such as a Second Life client. RequirementsStreaming audio and video from a Nokia N800 into Second Life requires the following:
Preparing the Nokia N800The procedure described in this document was tested with an N800 running Internet Tablet OS 2007 Edition version 3.2007.10-7. Instructions for downloading and installing the OS are available at the Maemo website. In addition to the OS, several other software packages will also need to be installed on the N800. To make this easier, the N800 should be put into red pill mode. Once in red pill mode, use the N800's Application Manager to refresh the package list and install the following packages:
Preparing the Streaming ServerThe procedure described in this document was tested with the Apple QuickTime Streaming Server (QTSS) running on a Mac OS X Server machine. Similar results are most likely possible with the open source Darwin Streaming Server (DSS). The only deviation from the standard QTSS set up was the placement of a Session Description Protocol (SDP) file in the/Library/QuickTimeStreaming/Movies/ directory of the server.
The SDP file contains all the information needed by the client to properly
find and understand the audio and video streams, such as type of encoding,
size of each frame, and addresses and port numbers of the streams. This
file could be crafted by hand (it is a plain text file), but it is
probably easier to generate it with a program such as QuickTime Broadcaster
or mp4live.
QuickTime Broadcaster was used to generate the following SDP file
(File->Export->SDP from within Broadcaster):
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 XX.XX.X.XXX b=AS:63 m=video 5434 RTP/AVP 96 c=IN IP4 XX.XX.X.XXX a=rtpmap:96 H263-2000/90000 a=fmtp:96 a=cliprect:0,0,144,176 a=framesize:96 176-144This SDP file can be used once the XX.XX.X.XXX address listed
in the file (in two places) is replaced with the address at which a
streaming server is located. Changing any part of the streams coming from
the N800 will most likely require changing the SDP file.
Preparing Second LifeOnly the owner of a parcel of land in Second Life can determine if media can be streamed to the land and which URLs they are streamed from. Both the built-in (press F1 while using the Second Life client) and online help have a section on how to enable streaming media. In short, theWorld->About
Land->Media menu offers options for audio and video streams. Only
the video stream is needed, as it includes it audio with the video. The
URL should be of the form rtsp://XX.XX.X.XXX/N800.sdp, where
XX.XX.X.XXX is the same address as listed in the SDP file on
the streaming server. The video stream will replace a chosen texture
(image) on the parcel of land in question. In addition to configuring the
land to stream media, it is also necessary to configure the client to
stream media by going to the Audio/Video tab of Preferences
(CTRL-P). The Second Life client can display streaming video
only if QuickTime is installed on the same computer.
Putting It All TogetherOnce the N800, QTSS, Second Life land, and Second Life client have been configured as above, the only thing left to do is start the audio and video streaming from the N800 by running the following command from the terminal (either via SSH or xterm):
-fps
15 option was needed to properly view the stream. The total time
delay between real time and the audio and video streams depends on the
network connections between all the points of interest, from the N800 to
the streaming server to the Second Life client (the Second Life servers
don't have anything to do with the streaming of the media; it all happens
through the client). The shortest delay yet observed is approximately
five seconds. With the screen turned off and the audio and video
streaming, the battery lasts more than three hours.
AcknowledgementsThanks to the folks on the FreeNode #maemo and #gstreamer channels for their generous advice and abundant patience, to Jun Ki Lee for providing access to his streaming server and advice about SDP files, and to Peter Boda at Nokia for getting me started with the N800 in the first place. | |