Streaming Media


What is Streaming Media?

Streaming media is a technology that enables you to include digital audio, video and other multimedia elements into your websites in a more seamless and efficient way. With streaming media, a web user does not have to wait to download a large file before seeing the video or hearing the sound. Instead, the media is sent in a continuous stream and is played as it arrives. Media typically consist of audio only, video with audio or any combination of audio, illustrated audio, video, synchronized graphics or animation.

How does it work?

The media files like audio, video etc. are specially formatted and then placed on a streaming server. These media files are called as hyperlinks by the web pages. On a web page when the media link is clicked by the users the contents of the media file begins to flow across the internet in a regular and successive stream from the streaming server to the user’s browser. After a small interval of time, audio and video files begin to play either in a pop up window or embedded into the web page. VCR is a type of control panel, used by the users to pause, rewind and fast forward the media clips.

Streaming Media with Linux server

Stream MPEG1/MPEG2/MPEG4/DivX/Xvid/MP3 video & audio over multicast.

# apt-get install vlc wxvlc

on shell of server

$ vlc –intf dummy -vvv –sout ‘#standard{access=udp,url=239.239.239.239:1234,sap=true,name=”Test Stream}’ –ttl 5 –loop test.avi

on clients shell to connect straight away:

$ vlc udp:@ip address:1234

or enable and open the playlist window to view Session Announcement Protocol:

$ vlc -vvv –extraintf sap
This is
Darwin Streaming Server install

# tar xzvf DarwinStreamingSrvr5.0-Linux.tar.gz
# cd DarwinStreamingSrvr5.0-Linux
# ./Install

The Install script will install the server software and create an admin user. you should remove the default admin username

# /usr/local/bin/qtpasswd -F -d ‘aGFja21l’

Now start the server:

# /usr/local/sbin/streamingadminserver.pl

Login and confirm passwords, and then give a video clip a try. Open an RTSP URL off your server in a video player.

for example

mplayer rtsp://domain name/sample_300kbit.mp4

build encoding tools

First to install LAME, SDL, along with a few other packages like FFMPEG. Lame and other tools are available from http://marillat.free.fr/

apt-get install lame lame-extras liblame-dev libid3-3.8.3-dev
apt-get install libsdl1.2-dev libsdl1.2debian-all
apt-get install libsdl-net1.2-dev libsdl-image1.2-dev libsdl-gfx1.2-dev
apt-get install nasm libtool libgtk1.2-dev
apt-get install ffmpeg libxvidcore2 libxvidcore-dev libfaad2-0 libfaad2-dev faad

Now to install FAAC from source.

tar xzvf faac-1.23.1.tar.gz
cd faac
chmod +x bootstrap
./bootstrap
./configure
make
make install

MPEG4IP is available for content creation and encoding.

Download the source release from mpeg4ip.sourceforge.net.

tar xzvf mpeg4ip-1.0.tar.gz
cd mpeg4ip-1.0
./bootstrap
make
make install

encoding video

hinted mpeg4

with transcode and ffmpeg
live streaming

with mp4live
publishing

embeding a movie in a webpage, metafiles, session announcement and playlists
presentation

why streaming media

why MP3

why MPEG-4

what other codec are there

why multicast

why VideoLAN

why DSS

what other server software is available

Install shoutcast server.

How do we install shoutcast?

Generally you dont want to run shoutcast as root as that can be really bad. so we create a shoutcast user:

1.) Login to root
2.) adduser shoutcast
3.) passwd shoutcast

Now it will ask for a new password set this and remember it.

Now login as the new shoutcast user.

Installing shoutcast:

Lets take shoutcast from nullsoft:

wget http://www.shoutcast.com/downloads/s…-glibc6.tar.gz

extract shoutcast:

tar -zxvf shoutcast-1-9-2-linux-glibc6.tar.gz

rm -rf shoutcast-1-9-2-linux-glibc6.tar.gz
mv shoutcast-1-9-2-linux-glibc6 shoutcast
cd shoutcast

How to configure shoutcast?

your going to want to edit the shoutcast configuration.

pico sc_serv.conf
or
nano sc_serv.conf

MaxUser
Password
PortBase

uncomment AdminPassword and set an admin password.

Now at this point you can go threw the settings and change them to what you want or you can save and start shoutcast and it will work perfectly.

to save crtl+x

How do i start shoutcast?

./sc_serv sc_serv.conf

WebHosting UK supports “Http Streaming”. Below is step by step information to make http streaming work on your account :-

After you encode your media files, there are 2 more steps in preparing your content for streaming from a Web server. creating Windows Media metafiles with .wax, .asx or .wvx, file name extension and adding tags to your HTML files. The HTML tag points the end user’s browser to the metafile, which points Windows Media Player to the contents of Windows Media file. A metafile must be used to reference the media because a direct reference to the media in an HTML tag will cause most browsers to attempt to download the media rather than stream it.

To create a Windows Media metafile you will need to Open a text editor, such as Microsoft Notepad. Type the following metafile script, replacing the URL with that of your media. Reference the media file just as you would in any other Web file.

Code:-

http://yourdomain/Path/YourFile.wmv” />
You can place the metafile in the same folder as that of your media. If you do so, you can specify relative path, which is simply the name of the file. The REF line would look like this:

Code:-

Save the text file using the name of your media file followed by the .wvx extension if the metafile points to a file with a .wmv extension, or .wax if the metafile points to a file with a .wma extension, such as YourFile.wvx. The file name extension .asx was used in previous versions of Windows Media Technologies. To add a tag to an HTML file Using a text editor such as Microsoft Notepad, open the Web page that you want to add the reference to the media to. Add the URL of the metafile. For example:

Code:-

Play this Windows Media file: http://yourdomain.com/Path/YourFile.wvx”> YourFile
Copy the Windows Media files (with .wma, .wax, .wmv, and .wvx file name extensions) to your Web server using a FTP client. When an end user clicks the reference on the Web page, the metafile is downloaded and Windows Media Player opens. Windows Media Player opens the metafile, and then opens and plays the Windows Media file from your Web server.