ChapterÂ 4.Â
Advanced use of VLC

Use the command line

All standard operations of VLC should be available from the GUI.
However, some complex operations can only be done from the command line
and there are situations in which you don't need or want a GUI. Here is
the complete description of VLC's command line and how to use it

You need to be quite comfortable with command line usage to use
this.

Note

Windows users have to use the
--option-name="value" syntax instead of the
--option-name value syntax.

Getting help

VLC uses a modular structure. The core mainly manages
communication between modules. All the multimedia processing is done by
modules. There are input modules, demultiplexers, decoders, video output
modules, ...

This chapter will only describe the "general" options, i.e. the
core options. Each module adds new options. For example, the HTTP input
module will add options for caching, proxy, authentication, ...

By using vlc --help, you will get the basic core
options. vlc --longhelp will give all the basic options
(core + modules). Adding --advanced will give the "advanced
options" (for advanced users). So vlc --longhelp --advanced
will give you all options.

Also, you might want to get debug informations. To do this, use
-v or -vv (this will show
lower severity messages). If your console supports it, you can add
--color to get messages in color.

Opening streams

The following commands start VLC and start reading the given
element(s)

Opening a file

Start VLC with:

% vlc my_file

VLC should be able to recognize the file type. If it does not, you
can force demultiplexer and decoder (see below).

A list of all video and audio codecs
supported by VLC is available on the VLC features
list.

Opening a DVD or VCD, or an audio CD

Start VLC with:

For a DVD with menus :

% vlc dvd://[device][@raw_device][@[title][:[chapter][:angle]]]

In most cases, vlc dvd:// or vlc dvd://[device] will do. [device] is for example /dev/dvd on GNU/Linux or D: on Windows (complete path to your DVD drive).

Modules selection

VLC always try to select the most appropriate interface,
input and output modules, among the ones available on the system,
according to the stream it is given to read. However, you may wish
to force the use of a specific module with the following options.

--intf <module>
allows you to select the interface module.

--extraintf <module>
allows you to select extra interface modules that
will be launched in addition to the main one. This is mainly useful for special control interfaces, like HTTP, RC (Remote Control), ... (see below)

--aout <module>
allows you to select the audio output module.

--vout <module>
allows you to select the video output module.

--memcpy <module>
allows you to choose a memory copy module. You should probably never touch that.

You can get a listing of the available modules by using vlc
-l

Stream Output

The Stream output system allows vlc to become a streaming
server.

For more details on the stream output system, please have a look
at the Streaming Howto.

will play file1.mpg in windowed (no-fullscreen) mode with the subtitles file file1.srt and will play file2.mpg with video filter distort enabled in fullscreen mode (item-specific options override global options)

Advanced use of filters

Filters

These are the old style VLC filters. They only apply to on screen
display and thus cannot be streamed.

/index.html gives access to
the playlist, allows you to add or delete items and to control
playback.

/info.html gives you statistics
and data about the usage of the server.

/admin/. This folder gives
more power and is therefore protected by a login/password. The
default couple is admin/admin. The passwords and users can
be changed in the .access file in the
VLC_directory/share/http/admin folder. (Each folder
can be protected, see AppendixÂ B, Building pages for the HTTP interface for more details).

/vlm/. This folder allows you to
control the VideoLAN manager (VLM). The VLM allows you to stream several
input streams with only one VLC instance. For more information about
VLM, please look at the Streaming Howto.

Other control interfaces

VLC includes a number of so-called interfaces that are not really
interfaces, but means of controlling VLC. Nevertheless, they are
enabled by setting them as interface or extra interface, either in the
Preferences, in General/Interface, or using -I or --extraintf on the
command line.

Hotkeys

This module allows you to control VLC and playback via hotkeys. It
is always enabled by default. You can use hotkeys in the video output window.

RC and RTCI

These two interfaces allow you to control VLC from a command shell
(possibly using a remote connexion or a Unix socket.

Start VLC with -I rc or --extraintf
rc. When you get the Remote control interface
initialized, `h' for help message, press h and Enter to get help
about available commands.

To be able to remote connect to your VLC using a TCP
socket (telnet-like connexion), use --rc-host
your_host:port. Then, by connecting (using telnet or netcat)
to the host on the given port, you will get the command shell.

To use a UNIX socket (local socket, this does not work for
Windows), use --rc-unix /path/to/socket. Commands
can then be passed using this UNIX socket.

The RTCI interface gives you more advanced options, such
as marquee control for the marquee subpicture filter (See filter
section).

Ncurses

This is a text interface, using ncurses library.

Start VLC with -I ncurses or --extraintf ncurses. You will then get something like that:

Compile the sources yourself

Use the plugin

If you open a link to a video file handled by the VLC plugin (To
get the list of handled types, browse to about:plugins)
or a page with an embedded video, the plugin should open and read the
video.

Build HTML pages that use the plugin (version <= 0.8.5)

The following API description is only valid uptill version 0.8.5 of the mozilla plugin.

Additionally to viewing video on all pages, you can build
custom pages that will use the advanced features of the plugin, using
Javascript functions to control playback or extract information from the
plugin.

The vlc plugin supports the following function calls:

play() : Start playing media in the plugin.

pause() : Pause playback.

stop() : Stop media playback.

fullscreen() : Switch the video to full screen.

set_volume(vol) : Set the volume. vol has to be an int in the 0-200 range.

get_volume() : Get the current volume setting.

mute() : Toggle volume muting.

set_int_variable(var_name, value) :

set_bool_variable(var_name, value) :

set_str_variable(var_name, value) :

get_int_variable(var_name) :

get_bool_variable(var_name) :

get_str_variable(var_name) :

clear_playlist() : Clear the playlist.

add_item(mrl) : Append an item whose location is given by the Media Resource Locator to the playlist.

next()

previous()

isplaying() : return true if the plugin is playing something.

get_length() : Get the media's length in seconds.

get_position() : Get the current position in the media in percent.

get_time() : Get the current position in the media in seconds.

seek(seconds,is_relative) : If is_relative is true, seek relatively to current time, else seek from beginning of the stream. Seek time is specified in seconds.

Here are a few examples of HTML pages that use the
Mozilla plugin.

Example 1

In this example, the plugin will read an HTTP stream
inside the web page. If the user goes fullscreen, he will have to press
f to go back in normal view.

Build HTML pages that use the plugin (version > 0.8.5.1)

Additionally to viewing video on all pages, you can build
custom pages that will use the advanced features of the plugin, using
Javascript functions to control playback or extract information from the
plugin.

The vlc plugin exports serveral objects that can be accessed for setting and getting information. When used improperly the API's will throw an exception that includes a string that explains what happened. For example when asking for vlc.input.length when there is no playlist item playing.

The vlc plugin knows the following objects:

audio : Access audio properties.

input : Access input properties.

playlist : Access playlist properties.

video : Access video properties.

log : Access log properties.

messages : Access to log message properties.

iterator : Access to log iterator properties.

The following JavaScript code shows howto get a reference to the vlc plugin. This reference can then be used to access the objects of the vlc plugin.

Audio object

vlc.audio.volume : a value between [0-200] which indicates a percentage of the volume.

vlc.audio.track : a value between [0-65535] which indicates the audio track to play or that is playing. (supported in vlc version > 0.8.6)

vlc.audio.channel : an integer between 1 and 5 that indicates which audio channel mode is used, values can be: "1=stereo", "2=reverse stereo", "3=left", "4=right", "5=dolby". Use vlc.audio.channel to check if setting of the new audio channel has succeeded. (supported in vlc version > 0.8.6)