The Wiidiaserver

August 5, 2007

The Wiidiaserver is the servercomponent of the Wiidiaplayer. It has a number of jobs:

  • Serve over http the html page and the swf file that contain the clientside Wiidiaplayer (and the accompanying images in the near future)
  • Serve over http dynamic requests from the player on directory structure (this may change in the future to RTMP requests)
  • Stream the media file to the clientside Wiidiaplayer
  • (in the future) serve by http pictures for a slideshow.

The streaming of the media file happens over a RTMP connection. RTMP has only been reverse-engineered last year, and when I started on the Wiidiaplayer, only 4 implementations existed that I knew of. There is of course the official Adobe implementation, which will cost you at least a couple of thousand dollars to use, just as the Wowza Media Server. Then there is the Red5 server, which seemed like a lot of overkill, and since they hinted at their homepage that it would not be able to stream flash video yet, it didn’t seem worth the trouble to try. Then there was a implementation in HaXe. This last server actually had me streaming my first video within 5 minutes, however, although the idea behind HaXe is interesting, the language seemed too young. Furthermore, I didn’t like the idea of having to ask people to install apache and the Neko VM. Since the whole HaXe implementation was only a couple of hundred lines, I figured I could port it to twisted without too much trouble.

The Wiidiaserver has grown by now beyond the port of the HaXe code. Although the initial idea was to create a class that could be used in general RTMP projects in twisted, I gave up on it. For one, I don’t have enough experience with twisted to know what one would expect from such a class, but also, trying to develop a too general implementation only leads to more code, more bugs, more problems. Right now the RTMPy project is developing just such an implementation, in case someone is looking for it, and TAPE is a server developed on it (although, at the time of writing it doesn’t do video streaming yet)

The Wiidiaserver component is developing in a way specific to the Wiidiaplayer project. The FLV files that it streams coming from flv providers. These are classes that will get de FLV data from different sources. The simplest is a class that just serves an flv file that’s on disk. The more complicated ones create the flv file on the fly, and in the near future I’ll implement classes that will get the flv data from youtube, or a video4linux source. The server has extra functionality to handle such files. For instance, when seeking, it’s possible that the requested data is not available yet. It will then do repeated RTMP calls to the Wiidiaplayer to inform the client of the delay and how long it will take.

As with all: the server is in development, and might not be stable. The code can be found at http://code.google.com/p/wiidiaplayer/ . The server needs root-permissions to run, and will retain these while running (this will change in the near future as well). This is not advisable on any system, especially those connected to the outside world. Doing so is therefore obviously at own risk.

To run the server, you need python, twisted and twisted-web; converting makes use of mplayer(mencoder) for video and ffmpeg for audio.

Advertisements

2 Responses to “The Wiidiaserver”

  1. SomeGuy Says:

    Am I right in understanding that you are using a SWF file on the Wii to do the client-side RTMP stuff? (and using Wiidiaserver to SEND the data from a normal PC)

    Therefore I cannot use SWF Verification with encrypted streams with this method 😦

    When I first saw your site, I thought you WROTE a RTMP implementation natively for Wii ! Then I realised back in the old days (ie 2007) we used to use PC->Wii media streaming with the internet channel, instead of doing it with a native application.

  2. wiidiaplayer Says:

    Yes, I think you’re correct (never did any encrypted flash streaming, so can’t comment on that).

    I wrote an RTMP server implementation for the PC. Back in 2007, no homebrew stuff was possible on the Wii, so indeed, no native wii implementation.

    I would guess that the native implementation for RTMP is not too difficult – RTMP is a pretty easy protocol. Getting the FLV codec to work (and doing the decryption) do seem much more tricky….


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: