Difference between revisions of "VLC media player"

From ArchWiki
Jump to: navigation, search
m (Add missing information)
(simplification and beautification of wikilinks, fixing whitespace, capitalization and section fragments (https://github.com/lahwaacz/wiki-scripts/blob/master/link-checker.py (interactive)))
 
(38 intermediate revisions by 21 users not shown)
Line 1: Line 1:
[[Category:Player]]
+
[[Category:Multimedia players]]
 +
[[de:VLC]]
 +
[[fa:پخش‌کننده_صوتی‌تصویری_VLC]]
 
[[ja:VLC media player]]
 
[[ja:VLC media player]]
 
From the project [http://www.videolan.org/vlc/ home page]:
 
From the project [http://www.videolan.org/vlc/ home page]:
: ''VLC is a free and open source cross-platform multimedia player and framework that plays most multimedia files as well as DVD, Audio CD, VCD, and various streaming protocols.''
+
:VLC is a free and open source cross-platform multimedia player and framework that plays most multimedia files as well as DVD, Audio CD, VCD, and various streaming protocols.
  
 
== Installation ==
 
== Installation ==
  
[[pacman|Install]] {{Pkg|vlc}} from the [[official repositories]].
+
[[Install]] {{Pkg|vlc}} from the [[official repositories]].
  
 
Notable variants are:
 
Notable variants are:
 
* {{AUR|vlc-git}} - Development branch.
 
* {{AUR|vlc-git}} - Development branch.
  
If you want to play audio CDs, you should also install {{Pkg|libcddb}}.
+
Notable optional dependencies are:
 +
* {{Pkg|qt4}} - for the GUI
 +
* {{Pkg|libcdio}}- for audio CD playback support
 +
 
  
 
== Language ==
 
== Language ==
Line 32: Line 37:
  
 
Restart VLC for the change to take effect.
 
Restart VLC for the change to take effect.
 
Note: You need to install {{Pkg|libtar}} from the [[official repositories]] to use the skinnable interface module.
 
  
 
== Web interface ==
 
== Web interface ==
Line 60: Line 63:
 
</nowiki>}}
 
</nowiki>}}
  
Then in ''System Settings > Details > Default Applications '' and on the ''Video'' drop-down menu, select ''Open VLC media player''.}}
+
Then in ''System Settings > Details > Default Applications '' and on the ''Video'' drop-down menu, select ''Open VLC media player''.
  
 
=== Twitch.tv streaming over VLC ===
 
=== Twitch.tv streaming over VLC ===
  
  # pacman -S python-pip
+
See [[Livestreamer#Twitch]].
  # pip install livestreamer
+
  
then to execute:
+
=== Playing streamed content from a local DLNA server ===
  
  $ livestreamer twitch.tv/name quality
+
If you find that trying to play uPNP/DLNA content (by going to ''View > Playlist > Local Network > Universal Plug'n'Play''), that vlc fails to see the DLNA server on the local network, then make sure that the firewall is not blocking port 1900 UDP. It is essential that this port is open in order to play local uPNP/DLNA content.
 
+
An example:
+
 
+
  $ livestreamer twich.tv/archlinux medium
+
 
+
Available streams qualities: high, low, medium, mobile, source
+
  
 
=== Control using hotkeys or cli ===
 
=== Control using hotkeys or cli ===
Line 86: Line 82:
  
 
Either run the script from the command line or register the script with keyboard shortcuts through your desktop.
 
Either run the script from the command line or register the script with keyboard shortcuts through your desktop.
 +
 +
Alternatively, you can use dbus-send [http://theelitist.github.io/control-vlc-media-player-through-d-bus as discussed here] to interact with VLC:
 +
$ dbus-send --print-reply --session --dest=org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
  
 
=== Preventing multiple instances ===
 
=== Preventing multiple instances ===
  
The default settings for VLC is to open a new instance of the program for each file that is opened. This can be annoying if you are using VLC for something like playing your music collection. To remedy the problem you can do the following:
+
The default settings for VLC is to open a new instance of the program for each file that is opened. This can be annoying if you are using VLC for something like playing your music collection. You can disable this in ''Tools > Preferences > Interface > Instances > Allow only one instance''. Optionally. tick ''Enqueue files when in one instance mode'' which keeps current file playing and adds any newly opened files to the current playlist.
  
# Open VLC.
+
=== Hardware acceleration support ===
# Go to ''Tools > Preferences'' ({{ic|Ctrl+P}}).
+
# Go to the Interface tab and find the "Instances" section.
+
# Tick "Allow only one instance".
+
# Optionally tick "Enqueue files when in one instance mode". This will keep the current file playing and add any newly opened files to the current playlist.
+
  
=== Harware acceleration support ===
+
See [[Hardware video acceleration]].
  
To enable hardware acceleration since version 2.1.x: ''Tools > Preferences > Input & Codecs'', then choose under ''Hardware-accelerated decoding'' the suitable item, e.g. {{ic|Video Acceleration (VA) API}} or {{ic|Video Decode and Presentation API for Unix (VDPAU)}}.
+
VLC automatically tries to use an available API, but you can override it by going to ''Tools > Preferences > Input & Codecs'' and choosing the suitable option under ''Hardware-accelerated decoding'', e.g. {{ic|Video Acceleration (VA) API}} for VA-API or {{ic|Video Decode and Presentation API for Unix (VDPAU)}} for VDPAU.
  
To enable hardware acceleration in previous versions: ''Tools > Preferences > Input & Codecs'', then check {{ic|Use GPU accelerated decoding}}.
+
=== systemd service ===
  
== Troubleshooting ==
+
{{Note|''cvlc'' is the ''Console VLC Player'', or VLC without graphical interface.}}
  
=== PulseAudio lag ===
+
{{Accuracy|{{ic|nobody}} is a valid user for daemons, should it still be changed?}}
  
When using PulseAudio as the audio output module, you might encounter audio/video sync problems. These problems can usually be [https://bbs.archlinux.org/viewtopic.php?pid=1101711#p1101711 fixed] by editing {{ic|/etc/pulse/default.pa}} or {{ic| ~/.pulse/default.pa}} to reflect the following changes. However, this can cause a new audio stuttering problem in some applications such as flash.
+
Change the {{ic|1=User=}} parameter.
{{bc|1=
+
 
.ifexists module-udev-detect.so
+
{{hc|/etc/systemd/system/vlc.service|<nowiki>
load-module module-udev-detect '''tsched=0'''
+
[Unit]
.else
+
Description=VideoOnLAN Service
}}
+
After=network.target
 +
 
 +
[Service]
 +
Type=forking
 +
User=nobody
 +
ExecStart=/usr/bin/cvlc --intf=lua --lua-intf=http --daemon --http-port 8090
 +
Restart=on-abort
 +
 
 +
[Install]
 +
WantedBy=multi-user.target
 +
</nowiki>}}
 +
 
 +
== Troubleshooting ==
  
 
=== Video broken or other issue after upgrade ===
 
=== Video broken or other issue after upgrade ===
  
 
Now and then VLC will have some issues with configuration even in minor releases. Before making bug reports, remove or rename your configuration located at {{ic|~/.config/vlc}} and confirm whether the issue is still there.
 
Now and then VLC will have some issues with configuration even in minor releases. Before making bug reports, remove or rename your configuration located at {{ic|~/.config/vlc}} and confirm whether the issue is still there.
 +
 +
If using a ffmpeg variant from the AUR, be sure that you have upgraded it as well.  Pacman will not upgrade it when necessary and a mismatch will break VLC.
  
 
=== Segmentation fault ===
 
=== Segmentation fault ===
  
When starting VLC you can get a segfault, a possible workaround to this is running the following:
+
When starting VLC you can get a segfault, and ruling out general factors such as [[Microcode]], a possible workaround to this is running the following:
   # /usr/lib/vlc/vlc-cache-gen -f usr/lib/vlc/plugins
+
 
 +
   # /usr/lib/vlc/vlc-cache-gen -f /usr/lib/vlc/plugins
 +
 
 
Then reinstall VLC.
 
Then reinstall VLC.
 +
 +
Another workaround can be reinstalling vlc within an {{ic|LD_PRELOAD}} environment:
 +
 +
# LD_PRELOAD=/usr/lib/libgobject-2.0.so.0 pacman -S vlc
  
 
=== Missing icons in dropdown menus ===
 
=== Missing icons in dropdown menus ===
Line 134: Line 149:
 
}}
 
}}
  
 +
=== Failed to open VDPAU backend ===
 +
 +
See [[Hardware video acceleration#Failed to open VDPAU backend]].
 +
 +
Since your system probably doesn't support VDPAU you should tell VLC to use VA-API instead, see [[#Hardware acceleration support]].
 +
 +
=== Video output overlaps the desktop, does not scale nor position properly ===
 +
 +
This happens at least on Intel cards, and a fix that reportedly solves the problem is setting the output in the video settings to ''OpenGL GLX (XCB)'' and the ''Input/Codecs'' decoding to ''VA-API'' (any of them).
 +
 +
=== No playback via SFTP of media files names containing spaces ===
 +
 +
If vlc does not play any videos or audio files over SFTP first confirm you have sshfs installed.
 +
 +
If it refuses to play any media files containing spaces via SFTP and always asks for authentication change the line
 +
 +
Exec=/usr/bin/vlc --started-from-file %U
 +
 +
to
 +
 +
Exec=/usr/bin/vlc --started-from-file %F
 +
 +
in the vlc.desktop file. [https://bugs.launchpad.net/ubuntu/+source/vlc/+bug/239431/comments/11]
 +
 
== See also ==
 
== See also ==
  

Latest revision as of 09:09, 3 June 2016

From the project home page:

VLC is a free and open source cross-platform multimedia player and framework that plays most multimedia files as well as DVD, Audio CD, VCD, and various streaming protocols.

Installation

Install vlc from the official repositories.

Notable variants are:

Notable optional dependencies are:

  • qt4 - for the GUI
  • libcdio- for audio CD playback support


Language

It seems VLC does not offer an option to change language in its Preferences menu. But you can use the LANGUAGE= prefix. For instance, modify the /usr/share/applications/vlc.desktop line:

Exec=/usr/bin/vlc %U

to:

Exec=LANGUAGE=fr /usr/bin/vlc %U

to switch VLC interface to French.

Skins

VLC can be "skinned" for a different look and feel. You can obtain new skins for VLC from http://www.videolan.org/vlc/skins.php.

Installation of skins is simple just download the skin you wish to use and copy it to:

~/.local/share/vlc/skins2

Open up VLC, click Tools > Preferences. When the preferences window opens up you should be in the "Interface" tab

Choose the "Use custom skin" radio button, and browse to the location of the downloaded skin.

Restart VLC for the change to take effect.

Web interface

Run VLC with the parameter --extraintf=http to use both the desktop and web interface. The --http-host parameter specifies the address to, which is localhost by default. To set a password, use --http-password, otherwise VLC will not allow you to log in.

# vlc --extraintf=http --http-host 0.0.0.0:8080 --http-password 'yourpasswordhere'

Or you can enable this feature in the UI by navigating to View > Add Interface > Web Interface.

VLC defaults to port 8080: http://127.0.0.1:8080

Edit /usr/share/vlc/lua/http/.hosts to allow remote connections. You will need to restart VLC in order for changes to take effect.

Tips and tricks

File association in GNOME

Copy the system desktop file to the local one (local .desktop files supersede the global ones):

$ cp /usr/share/applications/vlc.desktop ~/.local/share/applications/

Define its mime types (known playback file type abilities) by doing:

sed -i 's|^Mimetype.*$|MimeType=video/dv;video/mpeg;video/x-mpeg;video/msvideo;video/quicktime;video/x-anim;video/x-avi;video/x-ms-asf;video/x-ms-wmv;video/x-msvideo;video/x-nsv;video/x-flc;video/x-fli;application/ogg;application/x-ogg;application/x-matroska;audio/x-mp3;audio/x-mpeg;audio/mpeg;audio/x-wav;audio/x-mpegurl;audio/x-scpls;audio/x-m4a;audio/x-ms-asf;audio/x-ms-asx;audio/x-ms-wax;application/vnd.rn-realmedia;audio/x-real-audio;audio/x-pn-realaudio;application/x-flac;audio/x-flac;application/x-shockwave-flash;misc/ultravox;audio/vnd.rn-realaudio;audio/x-pn-aiff;audio/x-pn-au;audio/x-pn-wav;audio/x-pn-windows-acm;image/vnd.rn-realpix;video/vnd.rn-realvideo;audio/x-pn-realaudio-plugin;application/x-extension-mp4;audio/mp4;video/mp4;video/mp4v-es;x-content/video-vcd;x-content/video-svcd;x-content/video-dvd;x-content/audio-cdda;x-content/audio-player;|' ~/.local/share/applications/vlc.desktop

Then in System Settings > Details > Default Applications and on the Video drop-down menu, select Open VLC media player.

Twitch.tv streaming over VLC

See Livestreamer#Twitch.

Playing streamed content from a local DLNA server

If you find that trying to play uPNP/DLNA content (by going to View > Playlist > Local Network > Universal Plug'n'Play), that vlc fails to see the DLNA server on the local network, then make sure that the firewall is not blocking port 1900 UDP. It is essential that this port is open in order to play local uPNP/DLNA content.

Control using hotkeys or cli

Install openbsd-netcat.

Get script at: http://crunchbang.org/forums/viewtopic.php?pid=112035%23p112035#p112035

Follow instructions in script to setup a socket for VLC.

Either run the script from the command line or register the script with keyboard shortcuts through your desktop.

Alternatively, you can use dbus-send as discussed here to interact with VLC:

$ dbus-send --print-reply --session --dest=org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause

Preventing multiple instances

The default settings for VLC is to open a new instance of the program for each file that is opened. This can be annoying if you are using VLC for something like playing your music collection. You can disable this in Tools > Preferences > Interface > Instances > Allow only one instance. Optionally. tick Enqueue files when in one instance mode which keeps current file playing and adds any newly opened files to the current playlist.

Hardware acceleration support

See Hardware video acceleration.

VLC automatically tries to use an available API, but you can override it by going to Tools > Preferences > Input & Codecs and choosing the suitable option under Hardware-accelerated decoding, e.g. Video Acceleration (VA) API for VA-API or Video Decode and Presentation API for Unix (VDPAU) for VDPAU.

systemd service

Note: cvlc is the Console VLC Player, or VLC without graphical interface.

Tango-inaccurate.pngThe factual accuracy of this article or section is disputed.Tango-inaccurate.png

Reason: nobody is a valid user for daemons, should it still be changed? (Discuss in Talk:VLC media player#)

Change the User= parameter.

/etc/systemd/system/vlc.service
[Unit]
Description=VideoOnLAN Service
After=network.target

[Service]
Type=forking
User=nobody
ExecStart=/usr/bin/cvlc --intf=lua --lua-intf=http --daemon --http-port 8090
Restart=on-abort

[Install]
WantedBy=multi-user.target

Troubleshooting

Video broken or other issue after upgrade

Now and then VLC will have some issues with configuration even in minor releases. Before making bug reports, remove or rename your configuration located at ~/.config/vlc and confirm whether the issue is still there.

If using a ffmpeg variant from the AUR, be sure that you have upgraded it as well. Pacman will not upgrade it when necessary and a mismatch will break VLC.

Segmentation fault

When starting VLC you can get a segfault, and ruling out general factors such as Microcode, a possible workaround to this is running the following:

 # /usr/lib/vlc/vlc-cache-gen -f /usr/lib/vlc/plugins

Then reinstall VLC.

Another workaround can be reinstalling vlc within an LD_PRELOAD environment:

# LD_PRELOAD=/usr/lib/libgobject-2.0.so.0 pacman -S vlc

Missing icons in dropdown menus

This can happen under XFCE, there will be no more icons in dropdown menus, like the or the PCI card icon.

Execute these commands to reactivate these icons:

$ gconftool-2 --type boolean --set /desktop/gnome/interface/buttons_have_icons true
$ gconftool-2 --type boolean --set /desktop/gnome/interface/menus_have_icons true

Failed to open VDPAU backend

See Hardware video acceleration#Failed to open VDPAU backend.

Since your system probably doesn't support VDPAU you should tell VLC to use VA-API instead, see #Hardware acceleration support.

Video output overlaps the desktop, does not scale nor position properly

This happens at least on Intel cards, and a fix that reportedly solves the problem is setting the output in the video settings to OpenGL GLX (XCB) and the Input/Codecs decoding to VA-API (any of them).

No playback via SFTP of media files names containing spaces

If vlc does not play any videos or audio files over SFTP first confirm you have sshfs installed.

If it refuses to play any media files containing spaces via SFTP and always asks for authentication change the line

Exec=/usr/bin/vlc --started-from-file %U

to

Exec=/usr/bin/vlc --started-from-file %F

in the vlc.desktop file. [1]

See also