Videolan Quickstart 0.2 (includes virtual streaming)

Bill Eldridge bill at rfa.org
Mon Jan 28 07:48:13 CET 2002


VideoLan VLC/VLS/VLMS Quickstart, version 0.2      2002/01/28

Bill Eldridge, bill at rfa.org, Radio Free Asia
Copyright GNU GPL, version 2 or later (your option)

0) Disclaimer stuff
1) Configure/compile
2) Getting/building mkpassword
3) Finding a video file you know works
4) Basic vls.cfg
5) Basic input.cfg
6) Test vlms and linux vlc
7) Basic vls/vlc Linux test
8) Basic vlc on Windows test
9) vlc player behavior on Linux & Windows
10) Server gotchas
11) Multiple channels
12) Virtual streaming with ffmpeg
13) Multicasting - Help!!!
14) P.S.

0) This is the start of a longer videolan Quickstart,
which will be added to as I get more parts
working. I started this because I couldn't get
anything working in VideoLan even though I thought
I had everything configured right.

Currently I have vlms/vlc and vls/vlc working on
vob (MPEG) files, streaming locally on Linux and to
Windows net client.

If someone who knows much more about this stuff is eager,
he/she is welcome to steal this and expand it - please
tell me to step aside. Also, I take no responsibility
for any problems whatsoever caused by following my
advice. And yes, this would be better as html with
anchors.

1) Both the latest stable release and the last
CVS (2002/01/25) of vls/vlc/vlms worked in the end for me.
Run everything as root, at least until you figure it out
and maybe after.  I configured vls with:

./configure --disable-dvd

and vlc with:

./configure --enable-gnome

while vlms doesn't have configure, so I just did "make".

and ran "make", "make install" on them. (you can
do a "make uninstall" and "make clean"  or "make distclean"
as needed)

2) You need mkpassword, which I got by downloading
serveez-0.1.2 from ftp://ftp.gnu.org/gnu/serveez/
Trying to compile this failed (didn't have guile),
but I didn't need anything but mkpassword, so
I did a ./configure, cd squeeze-0.1.2/src,
make mkpassword and copied mkpassword to
/usr/local/sbin.  (you can put it anywhere in
your path).  At that point, you just type
"mkpassword" and enter the password you want
to encode.  Cut-and-paste tat that to your vls.cfg

3) My start is simply to stream a file, presentation_short.vob,
that I downloaded from ftp://ftp.videolan.org/pub/videolan/streams.
This is important, because the DTS_Organic.mpeg and
exotic_animal_sex.mpeg files I downloaded from the same site
*DIDN'T* work, nor did my own mpeg files.  Start with something
that works.  I've also had pretty good luck using ffmpeg,
*EXCEPT* the file seems to need to be 30 seconds or more
for vls to be able to latch onto it.  I use:

   ffmpeg -ad /dev/dsp1 /var/www/html/test.vob

(/dev/dsp1 is my TV card audio input)


4) You can compare my vls.cfg with the distribution vls.cfg to get
a better idea of what the section names mean - I wasted a lot of time
by keeping the wrong (original) name in the Inputs section, instead
of what I'd changed it to.  Note that I always start with IP addresses
instead of names to remove one possible source of errors.
In my case, my Linux server/client is at 172.30.0.1, and my Windows
laptop client is 172.30.0.2 - substitute your correct addresses.

File without original comments:

#----------------------------------------------------------------------------
BEGIN "Vls"
LogFile       = "/tmp/vls.log"                # log file
END

BEGIN "Groups"
monitor       = "help|browse|logout"
master        = "help|browse|start|resume|suspend|stop|shutdown|logout"
END

BEGIN "Users"
bill             = "biC4vi88iMezU:master"   # password 'bozo' using
mkpassword
dummy            = "idthWSwmfr8vQ:master"   # password 'idiot' using
mkpassword END

BEGIN "Telnet"
LocalPort     = "9999"                # where you'll start programs &
shutdown
END

BEGIN "NativeAdmin"
LocalPort     = "9998"                # No clue
END

BEGIN "Inputs"
myfiles = "local"                  # One branch of file inputs (content)
END

BEGIN "myfiles"
ConfigPath = "/var/www/html"     # Points to directory for input.cfg
END

BEGIN "Channels"
mychannel     = "network"           # One IP path (transport)
END

BEGIN "mychannel"       # type == "network"
SrcHost       = "172.30.0.1" # Or name, but not "localhost" nor
"127.0.0.1"
SrcPort       = "4321"
DstHost       = "172.30.0.1" # Or name, but not "localhost" nor
"127.0.0.1"
DstPort       = "1234"
END


5) My /var/www/html/input.cfg looks like:

#----------------------------------------------------------------
BEGIN "Input"
FilesPath             = "/var/www/html"    # Can be somewhere else
PgrmCount             = "3"
END

BEGIN "1"
  Name                  = "test"
  FileName              = "test.vob"
  Type                  = "Mpeg1-PS"
END

BEGIN "2"
  Name                  = "myprogram"
  FileName              = "presentation_short.vob"
  Type                  = "Mpeg2-PS"
END

BEGIN "3"
  Name                  = "exotica"
  FileName              = "exotic_animal_sex.mpeg"
  Type                  = "Mpeg2-PS"
END

but I already said that number 3 didn't work (tried Mpeg1-PS and
MPeg2-TS and still didn't work), so you can just change PgrmCount
to "2" and omit the 3rd example.

6) Basic vlms/vlc test (local Linux client)

First, test with vlms - start your Linux client with:

vlc --noaudio udpstream:0 at 172.30.0.1:1234

and then your one-shot server:

vlms -d 172.30.0.1:1234 -a off /mpegs/bill/presentation_short.vob

Your client should autmagically pop up a not-so-terribly
interesting video, but at least it's video.

7) When you go to start programs in vls, you'll be specifying 3 things:
  a) the actual file or media entry
  b) where the file/media lies in your content (directory/tree/filelist)
     structure, and
  c) what networking transport (UDP, multicast, carrier pigeon) it uses.

Make sure you're *NOT* in the vls source directory, or it
will use vls.cfg there instead of /usr/local/etc/videolan/vls/vls.cfg

Without further ado, the following should work:

    vlc --noaudio udpstream:0 at 172.30.0.1:1234
    vls &
    telnet localhost 9999
    login: bill
    password: bozo

    browse  [not really needed - do "help" for other commands]

    start myprogram mychannel myfiles --loop

8) Testing across net with Windows

Very similar, but in your vls.cfg, DstHost will
be the address of your Windows machine:

BEGIN "mychannel"       # type == "network"
SrcHost       = "172.30.0.1"
SrcPort       = "4321"
DstHost       = "172.30.0.2" # Or name of my Windows machine
DstPort       = "1234"
END


Start the server *FIRST*:

    vls &
    telnet localhost 9999
    login: bill
    password: bozo
    start myprogram mychannel myfiles --loop

    vlc --noaudio udpstream:0 at 172.30.0.2:1234

Note that your vlc client is pointing to the address
of the machine it's running on, not the server.
Also, see player and server notes below.


9) vlc Player behavior

When you start vlc on Linux as noted above, it will
give y ou a menu bar and a note saying "udpstream:0".
This means that the client is *ALREADY* listening.
When you start the server file with "start myprogram...",
a new client window should automatically pop up and
display the incoming program.

*HOWEVER*, on Windows, it seems that if the client
tries to connect before the server is running,
you get an "illegal operation" error that aborts
the program. Needless to say, start the server
first and make sure to start the client before
the program ends, or use the --loop option on the
server. (see Server Gotchas)

While my server was sending 160x128, the Windows
client defaulted to 720x576, and when I tried
to override this with either the preferences
or command-line options ("--width" & "--height")
the screen stayed black. At 720x576, a 160x128
movie looks pretty awful, but there's probably
a reasonable workaround I haven't figured out.

10) Server Gotchas

You can also use the --loop option on starting a program,
though vls sometimes can't return to the beginning of the
loop correctly and aborts the broadcast.

You can also use the up arrow and return to repeat
the last command, though it's hard to tell that because
vls shows an error message when you hit the up arrow.
Ignore it and hit return.

11) Multiple channels

Pretty similar, just add another channel in vls.cfg
Here I reuse the SrcPort, and only add a second
DstPort.

BEGIN "Channels"
mychannel     = "network"           # One IP path (transport)
channel2     = "network"           # One IP path (transport)
END

BEGIN "mychannel"       # type == "network"
SrcHost       = "172.30.0.1" # Or name, but not "localhost" nor
"127.0.0.1"
SrcPort       = "4321"
DstHost       = "172.30.0.1" # Or name, but not "localhost" nor
"127.0.0.1"
DstPort       = "1234"
END

BEGIN "channel2"       # type == "network"
SrcHost       = "172.30.0.1" # Or name, but not "localhost" nor
"127.0.0.1"
SrcPort       = "4321"
DstHost       = "172.30.0.1" # Or name, but not "localhost" nor
"127.0.0.1"
DstPort       = "1235"
END

This is easily started -

    start test mychannel myfiles
    start myprogram channel2 myfiles

and I can point my client at 172.30.0.1:1234 or 172.30.0.1:1235
(or start up 2 clients and watch both).

I can even play the same program on 2 channels:

    start test mychannel myfiles
    start test channel2 myfiles

Unfortunately, stopping a program uses only the
program name and the input name, so:

    stop myfiles test

would stop both channels. You can fix this with:

BEGIN "Inputs"
myfiles = "local"                  # One branch of file inputs (content)
files2 = "local"                  # Another branch of file inputs
(content)
END

BEGIN "myfiles"
ConfigPath = "/var/www/html"     # Points to directory for input.cfg
END

BEGIN "files2"
ConfigPath = "/var/www/html"     # Same input.cfg as "myfiles",
END                              # therefore same programs

and then do:

    start test mychannel myfiles
    start test channel2 myfiles
    stop myfiles test
    stop files2 test

There may be a better way of doing this, or it may
be waiting for the VideoLan folks to get the native
administrator on port 9998 working - stay tuned.

12) Virtual Streaming with ffmpeg

The test.vob file mentioned above does not have to be
finished. Using a generic BT878 video card, I can
write to my test.vob file with:

    ffmpeg -ad /dev/dsp1 /var/www/html/test.vob

and if I start the program 30 seconds later with:

    start test mychannel myfiles

vls will continue to stream out the file as it comes in.
(note the 30 seconds may change with different video
parameters - this has not been checked).

I also tested this using the newer V4L2 with kernel
2.4.18-pre7 and bttv-0.8.33 so I could get shared
access to the device, which allows me to use xawtv's
v4lctl to change channels & volume and such. On first
use, the videolan doesn't seem to track as well as with
V4L, but this might just require reconfiguring ffmpeg
or something similar. However, channel switching, et al.,
does work.

Two problems with this technique.  One, it's not really
"streaming" since you need both a 30 second buffer, and
you can't do strem backups. Two, if your vls crashes and
you restart, you're starting at the beginning of a program,
and not at the end.

It shouldn't take too much effort to modify vls to allow
starting from a point just before the end of a file and
proceeding from there (just requires an fseek(-X bytes, 2 for EOF))
but that's just a guess.

13) Multicasting

Help!!!

14) P.S.

Yep, that's it, so far. If you have good examples to extend this
functionality, please send it my way, bill at rfa.org.  Also tell me
if I screwed up somewhere - this is supposed to take the pain out
of getting something basic working.


-- 
Bill Eldridge
Radio Free Asia
bill at rfa.org

-- 
This is the vlc mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://www.videolan.org/lists.html



More information about the vlc mailing list