[vlc-devel] Re: streaming with vlc

Jean-Paul Saman jean-paul.saman at planet.nl
Fri Mar 19 14:26:01 CET 2004

Rafael Canato Luiz wrote:

>I'm trying to do a streamer of mpeg video studying the sources of vlc...
>Could you tell me how to open a mpeg file (ES) and packetizer it (TS)? 
>Or teach me how vlc decode this TS stream to an ES mpeg file... all I
>know is that vlc use the libmpeg2 library as a module, which I used
>before to obtain the pictures of a mpeg video, but I can't figure out
>the way vlc does it!!! 

I'll try to explain the way VLC handles a stream in a very general way 
using ASCII pictures ;-)

   [ text ]      is a VLC module
                                                   [ video decoder  ] -- 
[ filter ] -- [ video output ] --> video device
input <- [ access ]--[ demux 
file,                                            \ [ audio decoder ] -- 
[ filter ] -- [ audio output ] --> audio device
etc       <----------------------- VLC 

In the drawing above I ommited the interface modules and some others for 
simplicity reasons. Here is what happens:
1) an imput is examined by VLC access modules if they are know to a 
module, then it will claim it can read the stream and tell VLC core.
2) next a demux is choosen in much of the same way. The demux will 
separate audio and video tracks from the stream (even multiple ones)
3) the video stream is going to a matching video decoder (the demux 
detected which video decoder is needed).
4) the audio stream is going to a matching audio decoder (the demux 
detected which audio decoder is needed).
5) after the video decoder several filters can be applied (think of 
crop, scaling, etc.)
6) after the audio decoder several filters can be applied (think of 
audio downscaling, conversion of audio format to system native formats, 
7) the video is going to the video device of choice for the platform of 
the one that the user requested
8) the audio is going to the audio device of choice for the platform of 
the one that the user requested

This is all that is too it.

I cannot teach you all about MPEG TS/PS/ES, because it is a very large 
specification. Get your self a book to get acquinted with that.

Now about libmpeg2, that is an implementation of the MPEG specification 
and is used by VLC as a video decoder module in the above picture.

Hopefully this short overview gave you some idea of what is happening 
when decoding an Audio/Video stream.


Many greetings,
Jean-Paul Saman

VLC iPAQ maintainer                    http://www.videolan.org
RedHat Certified Engineer         RHCE number: 807202745005548

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 252 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20040319/3afaf7f0/attachment.sig>

More information about the vlc-devel mailing list