Friday, October 12, 2007

Newbie: Installing VLS (Linux-Codecs)

Howto Install Multimedia Codecs in Linux

What is the VideoLAN project ?

VideoLAN is a complete software solution for video streaming, developed by students of the Ecole Centrale Paris (http://www.ecp.fr) and developers from all over the world, under the GNU General Public License (http://www.gnu.org/copyleft/gpl.html) (GPL). VideoLAN is designed to stream MPEG videos on high bandwidth networks.

The VideoLAN solution includes:
VLS (VideoLAN Server), which can stream MPEG-1, MPEG-2 and MPEG-4 files, DVDs, digital satellite channels,

• digital terrestial television channels and live videos on the network in unicast or multicast,
VLC (initially VideoLAN Client), which can be used as a server to stream MPEG-1, MPEG-2 and MPEG-4 files, DVDs

• and live videos on the network in unicast or multicast ; or used as a client to receive, decode and display MPEG streams under multiple operating systems.

VLC works on many platforms: Linux, Windows, Mac OS X, BeOS, *BSD, Solaris, Familiar Linux, Yopy/Linupy and QNX. It can read: MPEG-1, MPEG-2 and MPEG-4 / DivX files from a hard disk, a CD-ROM drive, ...

• DVDs and VCDs,

• from a satellite card (DVB-S),

• MPEG-1, MPEG-2 and MPEG-4 streams from the network sent by VLS or VLC’s stream output.

• VLC can also be used as a server to stream:
MPEG-1, MPEG-2 and MPEG-4 / DivX files,

• DVDs,

• from an MPEG encoding card,

• to: one machine (i.e. to one IP address): this is called unicast,

• a dynamic group of machines that the clients can join or leave (i.e. to a multicast IP address): this is called multicast,

• in IPv4 or IPv6 .

To get the complete list of VLC’s possibilities on each plateform supported, see the VLC features page (http://www.videolan.org/vlc/features.html).
Note: VLC doesn’t work on Mac OS 9, and will probably never do.

VLS can stream:
an MPEG-1, MPEG-2 or MPEG-4 files stored on a hard drive or on a CD,
• a DVD located in a local DVD drive or copied on a hard disk,

• a satellite card (DVB-S) or a digital terrestial television card (DVB-T) ,

• an MPEG encoding card ;

• to : one machine (i.e. to one IP address): this is called unicast,

• a dynamic group of machines that the clients can join or leave (i.e. to a multicast IP address): this is called multicast,

• in IPv4 or IPv6 .

A Pentium 100 MHz with 32 MB of memory should be enough to send one stream on the network. When streaming a lot of videos stored on a hard drive, the actual limitation is not the processor but the hard drive and the network connection.

VLS works under Linux and Windows. To get the complete list of VLS’s possibilities on each plateform supported, see the streaming features page (http://www.videolan.org/streaming/features.html).


What is a codecs ?

To fully understand the VideoLAN solution, you must understand the difference between a codec and a container format
A codec is a compression algorithm, used to reduce the size of a stream. There are audio codecs and video codecs.

• MPEG-1, MPEG-2, MPEG-4, Vorbis, DivX, ... are codecs
A container format contains one or several streams already encoded by codecs. Very often, there is an audio stream and

• a video one. AVI, Ogg, MOV, ASF, ... are container formats. The streams contained can be encoded using different codecs. In a perfect world, you could put any codec in any container format. Unfortunately, there are some incompatibilities. You can find a matrix of possible codecs and container formats on the features page (http://www.videolan.org/streaming/features.html)
To decode a stream, VLC first demuxes it. This means that it reads the container format and separates audio, video, and subtitles, if any. Then, each of these are passed decoders that do the mathematical processing to decompress the streams .

There is a particular thing about MPEG:
MPEG is a codec. There are several versions of it, called MPEG-1, MPEG-2, MPEG-4, ...
• MPEG is also a container format, sometimes refered to as MPEG System. There are several types of MPEG: ES, PS, and
• TS

When you play an MPEG video from a DVD, for instance, the MPEG stream is actually composed of several streams (called Elementary Streams, ES): there is one stream for video, one for audio, another for subtitles, and so on. These different streams are mixed together into a single Program Stream (PS). So, the .VOB files you can find in a DVD are actually MPEG-PS files. But this PS format is not adapted for streaming video through a network or by satellite, for instance. So, another format called Transport Stream (TS) was designed for streaming MPEG videos through suchchannels.

VLS has a command line and a telnet interface, but no graphical interface !
• All the commands that show up in this document should be typed inside a terminal. .

Linux / Unix

Open a terminal :

commands that should be typed as root have a # prompt:

# command_to_be_typed_as_root
commands that should be typed as a regular user have a % prompt:

% command_to_be_typed_as_regular_user

Installing VLS

GNU/Linux & Mac OS X
Install the libraries
Many libraries are needed for particular uses : libdvbpsi (always needed)

• libdvdcss if you want to be able to access encrypted DVDs ,

• libdvdread if you want to be able to stream DVDs ,

• libdvb if you want to be able to stream from a DVB card (a satellite card or a digital terrestial TV card).

• Download the libraries from the VLS sources download page
(http://www.videolan.org/streaming/download-vls-sources.html).

For each library, uncompress, configure (unless for libdvb which doesn’t have a ./configure), compile and install:
% tar xvzf library.tar.gz
% cd library
% ./configure
% make
# make install
On GNU/Linux, check that the configuration file /etc/ld.so.conf contains the following line:
/usr/local/lib
If the line is not present, add-it and then run:
# ldconfig
On Mac OS X, run :
# ranlib /usr/local/lib/*.a
Install VLS
Download the sources of the latest release : get the file vls-version.tar.gz from the VLS sources download page
(http://www.videolan.org/streaming/download-vls-sources.html). Uncompress-it and generate ./configure:
% tar xvzf vls-version.tar.gz
% cd vls-version
8
To get the list of configuration options, do :
% ./configure --help
Then configure VLS:
if you want a basic VLS without DVD support, do möchten, machen Sie :

% ./configure --disable-dvd
if you want a VLS with DVD support, do:

% ./configure
if you want a VLS with DVB support, do:

% ./configure --enable-dvb --with-dvb=PATH_TO_DVB_DRIVERS --with-libdvb=PATH_TO_LIBDVB
Then, compile and install:
% make
# make install
You can also do a make uninstall, make clean or make distclean as needed.

No comments: