ACTLab TV Guide V1.0

 

Table Of Contents

 

 

Introduction

                       

            How ACTLab TV Works

 

            Technology

 

            Publication Process

 

                        Audio/Video Capture

 

                                    Analog Capture

 

                                    Digital Capture

 

                        Transcoding

 

                                    Transcoding for Archival Quality

 

                                    Transcoding for the Internet

 

                        Publishing

 

How To Setup Your Server:  Server Basics, Web Server Setup

 

How To Serve Your Content:  Serving Your Content And How To Create Playlists

 

            Server-side Integration

 

                        Webserver Configuration

 

                        Media Management

 

                        Playlist Management

 

                                    Alluvium Broadcaster

 

                                    Generating Playlists

 

                                    Playlist Format

 

            Client Integration

 

                        Alluvium Media Handler

 

                                    Invoking almh

 

                        Alluvium Media Player

 
Appendix

 

 

ACTLab TV Technology Guide V1.0

 

 

 

Introduction

 

This guide shows you how to take your audio/video content and make it streamable on an ACTLab TV station.  The goal of this guide is to create a resource for people who are starting from scratch.  The guide will cover all three steps of publishing your works:  digitization, transcoding, and web publishing.  If you do not know what these terms mean, don’t worry. We will go over all of these steps in this guide.

 

NOTE:  As with any technology movement, the popular trends will keep changing. ACTLab TV will do its best to keep its user guide up to date, please be on the look out for updates.

 

How ACTLab TV Works

 

ACTLab TV is based on three open source technologies developed by the Foundation for Decentralization Research.  Below is a brief explanation of each part.

 

 

Alluvium Core

 

ACTLab TV is powered by a peer-to-peer media streaming software called Alluvium. The Alluvium Core leverages the power of Swarmcast's distributed download acceleration to provide high-resolution video and audio streams, while reducing the bandwidth needed to host a stream. Alluvium can be thought of as BitTorrent for streams. This means there's no waiting for the file to download, which sets Alluvium apart from other peer to peer software. Click an Alluvium link and the video starts playing immediately. Additionally, Alluvium requires less bandwidth and scales to more simultaneous users than any other streaming technology.

 

Alluvium Media Player

 

The Alluvium media player has been built from the ground up to provide flawless playback of all video and audio files commonly found on the Internet. It uses native plug-ins on each platform so as to be easily extensible to future formats. Unlike most open source video players, it provides gapless playback between files, smooth resizing of the video window, flawless hardware, accelerated full screen playback, and a native look and feel on all major platforms.

 

Alluvium Media Server

 

Alluvium streams media files from any standard web server. The only additional requirement is an Alluvium playlist file, which contains a schedule of when each file should be played. Alluvium playlists are in an open format based on RSS. Unlike other RSS playlist formats, Alluvium playlists automatically synchronize all clients to the same file, creating optimal bandwidth efficiency through swarming downloads.

 

 

Publishing Process

 

This section covers what software and hardware you will need to create an ACTLab TV station.  There are essentially 3 steps to producing content for your stream: capturing, transcoding/archiving, and publishing.  Each section will begin with a detailed explanation of the hardware and software you will need for the process and then explore how one might go about implementing the process.

 

 

Video Capture

 

There are essentially three ways of capturing video: analog, DV, and DVD.  We will cover all three types and layout the specific hardware/software required for each.

 

Analog Video Capture - There are many types of devices that you can use to capture analog video. Our current top choice is the ATI TV Wonder.  The ATI TV Wonder comes in two models: either as an internal (PCI) or external (USB) device.  The internal offers MPEG 2 encoding at DVD quality.  The external offers similar performance, though the specifications may differ.  Other products we have found to offer a reasonable solution are the Happauge PVR and the Pinnacle Studio. 

 

DV Capture - The only hardware required for DV capture is an IEEE1394 (firewire, DV) interface.  Most new computers are being shipped with this feature included (all Apple computers come with this feature).  Make sure your computer has a firewire card. If it does not, your local computer store (or online retail shop) should have one for a reasonable price.

 

DVD - There are many DVD ripping applications on the Internet, which will allow you to convert your DVD directly into a MPEG 2 format.  DVD Shrink is one that we recommend.

 

If you are looking for a more “prosumer” type approach, Pinnacle Systems and Canopus are also both good choices.  We will later have more information on prosumer solutions. However, we feel at this time, most people would prefer the most economical/low-cost solution available.

 

Whichever solution you choose, make sure it comes with a software suite that can encode in MPEG 2, or convert from DV to MPEG 2. Here is a list of software that can currently handle MPEG 2:

 

ATI Multimedia Center (requires ATI Tuner)

Moonlight One Touch

Sorenson Squeeze

 

Now that you have acquired all the hardware and software, you can start capturing your footage.

 

We recommend capturing your files to the MPEG 2 format.  MPEG 2 offers a great quality and a decent file size when archiving your video.  It is also a standard, which is recognized by almost all media producers.  Our rough guidelines for encoding MPEG 2 are as follows:

 

Format

Resolution

Bit rate

VHS

320X240

4-6 Mbps

DV

720X480

5-7 Mbps

DVD

720X480

5-7 Mbps

 

Transcoding

 

Transcoding is the process of taking your captured footage and converting it to a streamable file.  There are many transcoders available to use. We recommend:

 

                        VLC Media Player

                        FFMPEG Encoder

                        Sorenson Squeeze

                        Moonlight One Touch

                       

Each of these has their pros and cons.  We currently recommend using VLC for single file conversions.  Sorenson Squeeze is also great, but can be expensive. It offers several desirable features such as watch folders, which will automatically convert files that you drop into the folder.

 

Below is a chart listing the resolutions and bit rates you should use for different servers. 

 

Server Connection Type

Connection Upload Capabilities

Resolution

Bit Rate

Enterprise

20mbps

720X480

768Mbps Video

256kbps Audio

High Speed

1.5mbps

720X480

512Mbps Video

128kbps Audio

Broadband

384kbps

320X240

256 Mbps Video

128kbps Audio

 

If you are tech savvy, there is also a free command line batch conversion tool called FFMpeg that works well.  Please remember, there many other transcoding software packages out there. If you find one that works better than those mentioned here, use it!

 

Once you have finished encoding all your files, you are ready to Publish!

 

Archiving

 

Once you have decided on your capture settings, it is time to start thinking about how you will archiving.  A couple of questions you might want to ask yourself are:

 

            “Where do I archive my content?”

 

You should archive your content in a safe area or remote location.  For example, all of our content is backed in at least two locations.  This prevents loss from power outages, fires, and other disasters.

 

 

            “Should I archive both my MPEG 2 and streaming files?”

 

The answer to this question depends on how much hard drive space you can afford.  You will have to take into account that you will want to back up all of your content.  For example if you have 200gigs of MPEG 2 videos, you will need 200 more gigs to make a back copy.  Some people suggest making DVD back ups.  We suggest keeping a local copy on the computers you use and then creating a backup on an external drive that can be stored off the premises. 

 

 

Publishing

 

Publishing your content may seem like a daunting task, because there are so many ways to go about doing it.  For the sake of trying to cover every aspect of publishing, this guide will assume you are starting from scratch. The first concept you will need to understand are networking basics.

 

How Alluvium Is Different From Other Servers

 

The Internet basically works through the communication of servers and clients.  For example, when you check your email, no matter what type of email you use, your computer (the client) makes a connection to a server to check and see what new messages you have.  Also when you go to a website, the web pages you view on your computer (the client) are actually hosted on a computer somewhere else on the Internet on a web server. 

 

One of the unique things about ACTLab TV is that unlike normal server-client relationships, ACTLab TV’s allows bandwidth sharing. This gives both the client (the user) and the server (content provider) a more efficient distribution system than previously available. 

 

 

Figure 1 Normal Client Server Relationship

Figure 2 - Swarmcast Client Server Relationship

 

What this means for you, the content producer, is that unlike older streaming technology, you can sustain a greater number of users on connections that previously could only handle a few.

 

What Type Of Server Do You Need?

 

There are several methods of web publishing as stated earlier.  Which route you choose will depend on your financial/hardware resources.  Here are several scenarios.

 

Resources

Bandwidth Speed

Bandwidth

Home Server

384Kbps-768Kbps

Unlimited

Web Hosting

1.0Mbps-3.0Mbps

Metered – amount per month varies

Web Server

1.0Mbps-10Mbps+++

Metered – usually more bandwidth than web hosting

 

Resources

Space

Cost

Home Server

Hard drive dependent

Broadband monthly cost and computer cost (currently about $30 - $50 a month for broadband and about $500 for a suitable PC), telephone and cable television companies are usually the only providers of broadband

Web Hosting

Usually several gigabytes

Monthly/Yearly cost of web hosting (plans currently start as low as $5 a month and up to about $50 a month, after which most people move to a dedicated web server). Hosting is also available from a slew of companies such as 1and1.com.

Web Server

Usually 60-100 gigabytes

Monthly/Yearly costs of web servers currently start at around $50.  Like web hosting, there are many options for web server hosting, such as 1and1.com, serverbeach.com, rackspace.com, and many others.  They all offer a variety of different grade servers.

 

As you can see from the charts there are many ways for you to obtain the proper connection in order to run an Alluvium server.  Once you have selected the type of web space you are going to use, you will need to figure out how you will connect to your server.   Note:  If you decide to use your desktop PC as your server, please make sure you have taken the proper steps to securing your Internet connection, such as setting up a firewall. 

 

 

Server-side Integration

 

            Unlike most streaming media solutions, Alluvium does not require a special server. All that is required to run an Alluvium stream is a standard HTTP web server such as Apache. A web server is embedded in the Alluvium broadcaster application for those running a station directly on their desktop computer. For those who are going to host their station on a dedicated server machine, we provide instructions on how to properly configure Apache to work with Alluvium streams. Similar configurations will work with other web servers.

 

Web server Configuration

 

            Configuring a web server to work with Alluvium is very simple. No special modules or even CGI scripts are necessary. The web server is only needed to serve static files: your media files and your playlist files. Put your media and playlist files in a directory where they will be accessible from your website. On many installations this is in the public_html directory of your website. On other systems it will be in /var/www or something similar. Make sure that the files have the proper permissions set so that they will be accessible to the Internet. You can check this by attempting to access a URL for an individual media file. If your web browser finds the file and attempts to download it, then you know that it is accessible to the Internet.

            It is important that you properly configure your web server to use the correct MIME type for Alluvium playlist files. Otherwise, your viewer’s web browsers will fail to load the playlist in the Alluvium player and they will be unable to view your stream. In Apache, you can configure the Alluvium playlist MIME type by editing the Apache config file and adding the line:

 

AddType application/x-alluvium .rss

 

On most Unix systems you can also set up the proper MIME type for all applications, including many web servers by adding the following line to the /etc/mime.types file:

 

            application/x-alluvium    rss

 

If you are writing your own HTTP server for use with Alluvium, just make sure that when it serves the Alluvium playlist files, it supplies the following HTTP header:

 

            Content-Type: application/x-alluvium

 

Media Management

 

            It is a good idea to keep your media files well organized. We suggest creating a media directory within the main website directory. Within that, create subdirectories for audio files, video files, and playlists. Then create subdirectories for various subtypes of audio, video, and playlist files. Keeping all of the files in subdirectories is convenient. For instance, you can point the broadcaster tool to the main media directory and it will scan through all subdirectories and select all applicable media files. This is also convenient for making backups of your media collection.

 

Playlist Management

 

            An Alluvium stream is created by taking your media files and organizing them into a playlist. The playlist determines when each media file should play. Using this information, the Alluvium client is able to download the media files from your HTTP server and stitch them together into a stream.

 

Alluvium broadcaster

 

            One way to generate playlist files is to use the Alluvium broadcaster tool. It is a cross-platform application written in C and using the wxWindows toolkit to provide a natural look and feel for each native platform. The broadcaster includes a graphical interface for playlist management. It also supports a headless mode where it can be used on the command line or in scripts. More documentation on how to use the broadcaster tool will be available when it is released.

 

Generating Playlists

 

            Another way to generate playlists is to write your own custom playlist generation code. This has proven to be a very popular choice among potential station managers. The broadcaster only works with directories containing media files. It scans the metadata in the media files to generate a playlist. However, many people already have their media metadata in a custom database of some sort - usually MySQL or something similar. If this is the case for you, then you should consider writing your own playlist generation code.

 

Types of Playlists

 

            Alluvium playlists can logically be thought of as being of three basic types. The first type is a static playlist. It contains a number of entries to media files, for instance 24 hours of programming. The playlist is played to the end and then refreshed, hopefully yielding a new playlist with another 24 hours of content. The second type is dynamic playlists. Since the playlist refreshes when it gets to the end, an extremely short playlist (say 2 items) allows for flexibility in programming which is useful for live request shows. Static and dynamic playlists are actually technically the same. They are just two different styles of playlist generation: generating a long playlist with all programming included or generating a short playlist with only the files, which are going to be played in the near future. The third type is a live playlist. These playlists do not include any individual items. They include a base URL for items and then automatically calculate file names based on the current time. This type of playlist is used in conjunction with our live broadcasting software, which splits up a live recording into a number of small sequentially numbered files.

 

Playlist Format

 

            The Alluvium playlist format is based on the RSS vocabulary for XML files. It uses standard RSS 1.0 tags.

 

Constraints on Playlist Generation

 

            There are a number of considerations to make when generating Alluvium playlists. First, every playlist must have a start time, otherwise the stream will not play. Second, every media file must have a duration or else it will be skipped. Finally, if you are generating a playlist dynamically, the smallest allowed size is two items. This means that, for instance, if you have a dynamic playlist management system where users can queue up media files to be played live, they can not edit the first two items in the queue. Once a playlist is generated with those two items, they are locked in and cannot be changed. The users (clients) will have already fetched the playlist and there is no way to inform them that it has changed. Clients cannot be updated on the new playlist until the old playlist expires, and can reconnect to the server to fetch a new one.

 

 

Client Integration

 

            Integrating the Alluvium player with your application is very simple. The Alluvium player is a command line application. Web browser integration is provided through the browser’s ability to launch command line applications for special MIME types. If the station’s web server is properly configured then the browser should automatically launch Alluvium whenever a playlist link is clicked. Integrating Alluvium into your application should be just as easy, because we provide a useful utility that does all the hard work for you. We call it the Alluvium Media Handler.

 

Alluvium Media Handler

 

            The Alluvium Media Handler (almh) is a very useful utility, which handles all of the hard work of launching and managing an instance of Alluvium. It takes care of launching a Java instance, and loading the Alluvium core and the Swarmcast download accelerator. It will also check to make sure that multiple instances are never launched, as one Alluvium and Swarmcast instance are sufficient to handle all streams. It will also take care of launching a media player once the core is ready. When Alluvium is installed, it configures the web browser to launch almh whenever an Alluvium playlist link is clicked. In this configuration, it will tell almh to use the Alluvium Media Player to play the stream. However, when you are invoking almh on the command line you can specify any media player you wish. We have also tried it with VLC and Mplayer. The Alluvium Media Player was developed to give superior playback quality and performance, but don’t take our word for it. Compare it to your favorite player yourself.

 

Invoking almh

 

            The almh program is simple to invoke. The syntax is:

 

                        almh playlist player player-args

 

            For instance, here’s how to watch ACTLab TV with Media player and tell Mplayer to use XV output and to loop forever:

 

            almh http://actlab.tv/media/rss/video.rss Mplayer -vo xv -loop 0

 

            The almh instance will then check to see if there is already another almh instance running. If there is not already another instance, it will initialize the core by running Java, invoking the core, invoking Swarmcast, waiting until they are both running, and then moving on. If there is another instance, it will skip initialization. After initialization, almh will tell the core to load the stream specified by the given playlist file. It will then launch the media player with the given arguments, pointing it to the stream generated by the core. The Mplayer invocation, in this case, will look something like this:

 

            mplayervo xv –loop 0 http://localhost:9090/filestreams/SomethingRandomHere

 

            As this invocation demonstrates, there are some constraints on your media player. It must be able to be invoked from the command line and you must be able to specify items to be played on the command line. Also, you must be able to specify on the command line that the player should loop on the same input file forever. The URL supplied to the player is generated by the Alluvium core and will contain a different media file each time it is invoked.

 

Alluvium Media Player

 

            The Alluvium Media Player was developed by Greg Hazel of the Alluvium team in response to a number of playback issues in VLC and Mplayer, which made the playback of Alluvium streams look less than perfect. The main problem that plagues open source video players is flicker in between files. Most players are constructed to close and reinitialize the video device in between files. This causes the desktop background to appear briefly in between files, causing an unpleasant flicker, which breaks the feel of a continuous stream. Another common problem is that many players will resize the video window to the native size of the video. When watching a stream containing videos of different sizes, this will also disrupt the fluidity of the stream. Alluvium Media Player, however, was designed from the beginning to give flawless playback without any flicker or resizing between files, both in windowed and full screen modes. Additionally, many players have broken or incomplete implementations of some video codecs. The Alluvium Media Player avoids this problem by not implementing any of its own codecs. It uses native plugins on all platforms. This allows the best available implementations to be chosen for each codec and for new codecs to be added dynamically at any time. More information about the Alluvium Media Player will be available after its release.