Documentation:Streaming HowTo New

From VideoLAN Wiki
Jump to navigation Jump to search

This documentation explains how to stream, transcode and save streams using VLC media player.

NOTE: This is work in progress. For a more complete, yet outdated, documentation on Streaming with VLC please see the old Streaming HowTo.


VLC media player is able to stream, transcode and save different media streams. For more information about the formats and codecs supported please see the VideoLAN Streaming Features list.


Trancoding is the process of taking a media file or stream and converting it to a different format or bitrate. There are two methods for trancoding in VLC, via the GUI (VLC's default interface) or via the commandline. The term transcode by itself normally refers to converting one media format to another and saving the output to a file (i.e. no streaming involved).

Trancoding using the GUI

One of the methods of transcoding is via the GUI. To access this:

  1. In VLC, go to "Media >> Convert / Save..." (Ctrl+R).
  2. Add the input file(s) or stream(s) you want to transcode. Press "Convert / Save".
  3. In the "Convert" windows specify the destination file name (including file extension - e.g. on Windows "C:\out.mp3").
  4. Select the desired codec from the profile list. To check/edit the settings of a given profile press the "Edit selected profile" button. Profiles can also be added/deleted.
  5. Press "Start".

If the profile settings were compatible and transcoding was sucessful a playable destination file should be created.

Using the commandline

Another method of transcoding is via the commandline. This is more flexible than via the GUI as it enables full usage of the modules and options available in VLC.

To use the VLC's commandline you need to have access to the commandline interface, for example via a shell.

Windows-based systems

On Windows-based system Command Prompt can be used. This can be found in the "Accessories" folder of the Start menu. Alternatively by going to "Start >> Run..." or pressing "Windows key + R", entering "cmd" into the text field and press "OK" or Enter.

Once the Command Prompt window is opened navigating to the folder/directory where VLC is located is easiest for using the commandline as only "vlc.exe" or "vlc" (as the .exe part is assumed) needs to entered to run VLC. If VLC is installed in the default location (on a 32-bit system) running:

cd "C:\Program Files\VideoLAN\VLC"

Should change to the directory where vlc.exe is located.

Unix systems

On Unix-based system (such as Linux and Mac OS X) a terminal window can be opened. Running "vlc" should be all that is needed to open VLC.

Transcoding commandline string structure

A typical commandline string for converting a file to another format is:

vlc --sout "#transcode{[TRANSCODE_OPTIONS]}:std{[OUTPUT_OPTIONS]}" INPUT

Where INPUT is the input stream, [TRANSCODE_OPTIONS] are the options set for the desired output format, codecs, bitrate etc. and [OUTPUT_OPTIONS] are the option set for the output type. --sout is the stream output commandline option.

Example commandline: Converting an audio file to a MP3 file

An example usage might be converting an audio file to a MP3 file:

vlc --sout "#transcode{acodec=mp3,ab=128,channels=2,samplerate=44100}:std{access=file,mux=raw,dst=OUTPUT}" INPUT

Where INPUT is the input file ans OUTPUT is the destination file (for example "C:\out.mp3" on Windows or "/home/username/out.mp3" on a *nix system). The above sout string is the default "Audio - MP3" profile setting accessible via the GUI. It will convert an audio input to a 128kbps CBR MP3 file (sample rate 44100Hz, 2 channels).

Other examples commandline strings

Convert an audio input to an uncompressed WAVE (*.wav) file:

vlc --sout "#transcode{acodec=s16l,channels=2,samplerate=44100}:std{access=file,mux=wav,dst=OUTPUT}" INPUT

Convert an audio input to an AAC file (MP4 container):

vlc --sout "#transcode{acodec=mp4a,ab=128,channels=2,samplerate=44100}:std{access=file,mux=mp4,dst=OUTPUT}" INPUT

See also