Linux Commands Examples

A great documentation place for Linux commands


the VLC media player

see also : qvlc - svlc - nvlc - rvlc - cvlc


vlc [OPTIONS] [ITEMS]...

add an example, a script, a trick and tips

: email address (won't be displayed)
: name

Step 2

Thanks for this example ! - It will be moderated and published shortly.

Feel free to post other examples
Oops ! There is a tiny cockup. A damn 404 cockup. Please contact the loosy team who maintains and develops this wonderful site by clicking in the mighty feedback button on the side of the page. Say what happened. Thanks!



How to get length of video file from console?

Something similar to:

ffmpeg -i input 2>&1 | grep "Duration"| cut -d ' ' -f 4 | sed s/,//

This will deliver: You can also use ffprobe, which is supplied with most FFmpeg installations:

ffprobe -show_format input | sed -n '/duration/s/.*=//p'

… or:

ffprobe -show_format input | grep duration | sed 's/.*=//')

To convert into seconds (and retain the milliseconds), pipe into:

awk '{ split($1, A, ":"); print 3600*A[1] + 60*A[2] + A[3] }'

To convert it into milliseconds, pipe into:

awk '{ split($1, A, ":"); print 3600000*A[1] + 60000*A[2] + 1000*A[3] }'

If you want just the seconds without the milliseconds, pipe into:

awk '{ split($1, A, ":"); split(A[3], B, "."); print 3600*A[1] + 60*A[2] + B[1] }'


enter image description here


Is there a way to set the default buffer for VLC?

--file-caching seems to be what you're after. Do you start vlc from command line? Then you can add

alias vlc="vlc --file-caching=10000"

to your .bashrc.

Within the GUI you'll find the option at Tools->Preferences->Show settings: "All" -> Input/Codecs, and then scrolling down.


Some songs in my music collection are quieter than others, what can I do?

If some songs in your music collection seem quieter than others, this is either because:

  • Their average volume is in fact lower (in dB)
  • They are not as heavily compressed as others, so they sound quieter, while in fact their peaks are the same. In my experience, this only happens when you compare e.g. classical records to modern pop, or jazz music to metalcore. So probably not your average listening scenario.

You really don't want to apply dynamic range compression again, since what you'll get is what you mostly experience when listening to radio stations that employ technicians who have no idea what they're doing. The chorus of a song will not seem as loud as the rest, when it's overcompressed.

Plus, guitar equipment is mostly tailored to electric guitars, which have a much smaller frequency band than a typical pop/rock song.

Let mastering engineers do their job, and try to regulate the playback volume only – not the playback dynamics. This is really something that only works well with movie audio.

I'd suggest running a ReplayGain analysis over your music collection, which will add a metadata record to your files that identifies their perceived loudness. Playback devices (and I assume most players) should respect this ReplayGain value and match the volume accordingly so you'll never have to worry about mismatches again.

For Linux, mp3gain is the de-facto standard for calculating ReplayGain. See here for more: Replay Gain in Linux


How can I solve VLC's dependency "vlc-nox"?

Some of the packages, like gstreamer, are not in the standard repository. You need to enable download from multiverse and universe repos.

Software soruces window

More info on:


Live Screencast under Linux

Another product that you can try :

WebcamStudio For GNU/Linux


Default path for installed binary?

I suppose

which vlc

will do the trick if the path the file was installed is on the System Path.


Playing random short clips from a collection of movies

Make a script that adds your movies in a playlist and play it in VLC. You can add start- and stop-time like this:


The EXTINF-value is the movie length in seconds. VLC will add that for you if you save a playlist of all your movies.

Something like


in a bash-script should do it.


VLC Stream Size

I was able to do it with the --v4l2-width=1280 --v4l2-height=720 options proir to opening the stream.


VLC, realtime priority and rtkit

Have you tried changing nice level with the nice command?

nice -0 vlc

if it works you can put it in a bash-script and create an alias to vlc, so it will always start with nice 0


Is it possible to play a song in vlc player out of the command line?

Short Answer is yes.

The official VLC command-line help wiki page can give you all the commands you need, and you should be able to just type:

vlc name.mp3

That should open the file, if you have custom devices for output you would specify that in the command line.


This manual page documents briefly the VLC multimedia player and server.


VLC follows the usual GNU command line syntax, with long options starting with two dashes (’-’). For a precise description of options, please use "vlc --help".

The complete list of VLC options depends on what plugins are installed because they automatically add their own options. Please use "vlc --longhelp --advanced" for a complete list of available options.


VLC recognizes several URL-style items:
*.mpg, *.vob, *.avi, *.mp3, *.ogg, *.opus

Various multimedia file formats

dvd://[<device>][@<raw device>][#[<title>][:[<chapter>][:<angle>]]]

DVD device (for instance dvd:///dev/dvd). The raw device is optional and must have been prepared beforehand.


VCD device (for instance vcd:///dev/cdrom).

udp://[@[<multicast address>][:<local port>]]

UDP stream, such as one sent by VLS or another VLC. Usually "udp://" is enough.

http://<server address>[:<server port>]/[<file>]

HTTP stream

rtsp://<server address>[:<server port>]/<stream name>

RTSP Video On Demand stream


Execute a playlist command. Commands are: pause (pause execution of other items), and quit (close VLC).

see also

Online documentation:


This manual page was written by Sam Hocevar <sam[:at:]zoy[:dot:]org>, for the Debian GNU/Linux system (but may be used by others).

How can this site be more helpful to YOU ?

give  feedback