Advertisment

Video Streaming in Linux

author-image
PCQ Bureau
New Update

Streaming is a growing technology that let’s you watch video and TV channels off the Web. It helps in saving time and precious bandwidth spent in downloading huge audio and movie files from the Web. In this article we’ll walk you through the steps in setting up a video-streaming server in Linux. We have used the Drawin Streaming Server 3 for Linux here. The server consists of two parts. One is the Darwin Steaming Server for playing a single media file continuously. This is commonly used by on-demand video sites. The other is the Play-list Broadcasting Server for playing files from a Play-list. This is used to set up broadcasting stations on the Web. You can download the Server from

www.apple.com or take it from the October CD of

PCQuest.

Advertisment

Darwin Streaming Server Install



First, copy and unzip the files in the Darwinsrvr3-linux.gz Zip folder (located in \cdrom\scrcode\ directory on PCQuest’s October CD) to the /root directory. To unzip, open the Terminal Console and give the following command: 

tar

-zxvf darwinsrvr3-linux.gz

This will create and unzip all the files in a directory called DarwinSrvr3-linux. Now to install the Darwin Streaming Server 3, run the installation script from the DarwinSrvr3-linux directory. To run the script issue the following commands in the Terminal Console:

Advertisment

cd /root/DarwinSrvr3-linux



./install

The Darwin Steaming Server 3 is installed with both the Darwin Streaming server and the Playlist Broadcasting server. We’ll now configure these separately.

Configure



The Darwin Streaming Server is almost all pre-configured. You just need to put a few MOV files, on the Linux box in the /usr/ local/movies directory.

Advertisment

An important point to note here is that not all MOV files can be streamable. You have to add a ‘hint track’ to make a MOV streamable. The hint track tells the server, how the data should be moved over the network or the Internet. To add a hint track to your MOV file, open it in QuickTime Pro and click on the ‘Save As’ tab. Enter a file name and from ‘Export’ tab select ‘Hinted Movies’. This will convert your MOV file into a stream-able file.

To start the streaming server, type the following in the Terminal Console.

#steamingadmin.pl

Advertisment

Your server is running now. To play the movie files from on the client, you’d need QuickTime player. Open QuickTime and go to, File > Open > URL. Type the IP address of your streaming server followed with the name of the file you want to view as rtsp://pcqlabs.com/. Here, RTSP is the protocol used for streaming, and pcqlabs.com is the domain name of the machine we used for doing this. You can change this name to suit your company.

You can also control, monitor, and check the status of you streaming server from a browser interface typing the URL of your streaming server, such as http://:1220.

Playlist Broadcast Server Configure



You can manage and monitor the server over a Web-based interface
The Playlist Broadcasting Server can be configured through an easy-to-use Web-based interface. Open your Web browser and type the URL of your streaming server with the port number, that is, http://: 1220. Port 1220 is specific for the streaming server Web-interface. You’ll be asked to enter your username and password. Enter, ‘streamingadmin’ as the user name and ‘default’ as password (you can change these later). This brings up a Web page with the management interface.

Advertisment

We will specify a playlist name; something called a SDP file and the playlist mode here. To specify a playlist file, go to Settings > Playlist Settings > Create New Playlist, and enter the name of the play-list you wish to create. Next specify an SDP (Session Description Protocol) file that’ll be used by the clients to run the playlist. For this, in the ‘Playlist URL’ text box, specify a file name, such as ‘broadcast.sdp’ (note the SDP extension). This file contains information about the format, timing and authorship of the content to be streamed. In the ‘Playlist Mode’, select the mode in which you wish to play the pre-recorded media, such as sequential, looped or random. Click on the ‘Create’ button. This creates your playlist directory, SDP file and a configuration file (broadcast.config) for this broadcasting server.

Next you need to add a few MOV files to your playlist directory. The MOV files you wish to add should all be initially placed in the /usr/local/movies directory. To add a movie, click on Add/Remove movies. A new Web page will come up. Select the movie files and add them to the playlist. This process will also automatically generate a playlist file called ‘broadcast.

playlist’.

To start the broadcast server, you need to change the default IP address and port number in the ‘broadcast.config’ file, located in /var/streaming/playlists/ , to the IP address and port number 5004 of your streaming server. You will also need to copy ‘broadcast.sdp’ from /var/streaming/playlist/ broadcast directory to the /usr/local/movies on the server.

Advertisment

To start your server, type the following in the console:

Playlistbroadcaster /var/streaming/playlist/broadcast/broadcast.config

On the client’s end, start the Quick Time player. Go to File > Open URL and type the IP address of the streaming server with the name of the required SDP file, such as

Advertisment

rtsp:///broadcast.sdp

We have discussed the installation and configuration procedure of a streaming server on Linux. However, for presenting the content to clients in a user-friendly way, you will need to embed the corresponding links into a web page. The server will also need management of media content and frequent updating of the corresponding front-end too.

Sanjay Majumder

Advertisment