VLC

来自 Arch Linux 中文维基

项目主页VLC for Linux:

VLC 是一个免费的开源跨平台多媒体播放器和框架,可播放大多数多媒体文件以及 DVD、音频 CD、VCD 和各种流媒体协议。

安装[编辑 | 编辑源代码]

安装 需要的软件包: vlc

VLC 的其他版本:

  • vlc-gitAUR - 开发者分支版本。
  • vlc-noxAUR - 不支持X服务的版本。

语言[编辑 | 编辑源代码]

VLC 在其“首选项”菜单中不提供更改语言的选项。

但是你可以修改VLC的桌面文件来修改语言。

这个文件在这个路径中 /usr/share/applications/vlc.desktop

打开这个文件你可以看到这么一行代码。

Exec=/usr/bin/vlc %U

如果你要修改VLC的语言为法语那么你可以这样子修改这一句话。

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

格式如下

Exec=env LANGUAGE=你要修改的语言缩写 /usr/bin/vlc %U

主题[编辑 | 编辑源代码]

VLC 可以更换不同的主题从而获得不同的外观和感觉。您可以在VLC的主题网站上获得你喜欢的主题。 VLC主题

下载好的主题包,请将它并将其移动到~/.local/share/vlc/skins2/

打开 VLC,单击 工具 > 首选项.当首选项窗口打开时,您应该在“界面”选项卡中

选择“使用自定义皮肤”单选按钮,然后选择下载的皮肤。

重新启动 VLC 以使更改生效。

网页界面[编辑 | 编辑源代码]

Run VLC with the parameter --extraintf=http to use both the desktop and web interface. The --http-host parameter specifies the address to bind 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 --http-port 8080 --http-password yourpasswordhere

To enable the web interface from the graphical interface, navigate to View > Add Interface > Web Interface. Set the password via Tools > Preferences > Show settings: All > Interface > Main interfaces > Lua > Lua HTTP > Password.

VLC defaults to port 8080: http://localhost: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.

使用提示和技巧[编辑 | 编辑源代码]

通过使用VLC进行Twitch.tv 传输[编辑 | 编辑源代码]

参见Streamlink#Twitch.

从本地 DLNA 服务器播放流内容[编辑 | 编辑源代码]

如果您发现尝试播放 uPNP/DLNA 内容(通过转到查看>播放列表>本地网络>通用即插即用),该 vlc 无法在本地网络上看到 DLNA 服务器,请确保防火墙未阻止端口 1900 UDP。必须打开此端口才能播放本地 uPNP/DLNA 内容。(机翻)

使用快捷键[编辑 | 编辑源代码]

安装 openbsd-netcat.

在这个网站获取脚本: https://crunchbang.org/forums/viewtopic.php?pid=112035%23p112035#p112035

按照脚本中的说明为 VLC 设置套接字。

从命令行运行脚本,或通过桌面使用键盘快捷键注册脚本。

或者,您可以使用 MPRIS 与 VLC 进行交互。

也可以使用 ncurses 接口启动 vlc:

$ vlc -I ncurses

具体参见 documentation

防止多个实例(机翻)[编辑 | 编辑源代码]

原标题:Preventing multiple instances

VLC 的默认设置是为打开的每个文件打开程序的新实例。如果您使用 VLC 播放音乐收藏等内容,这可能会很烦人。您可以在“工具”>“首选项”>“>实例界面”中禁用此功能>“仅允许一个实例”。或者,在一个实例模式下勾选 排队文件 以保持当前文件播放并将任何新打开的文件添加到当前播放列表。

视频加速[编辑 | 编辑源代码]

具体参见 视频加速

VLC会自动尝试使用可用的API,但您可以通过转到“工具”>“首选项”>“输入和编解码器”并在“硬件加速解码”下选择合适的选项来覆盖它,例如用于VA-API的视频加速(VA)API或用于VDPAU的视频解码和演示API for Unix(VDPAU)。

系统级服务[编辑 | 编辑源代码]

VLC的Web界面可以从systemd启动。首先,您需要创建一个默认用户:

# useradd -c "VLC daemon" -d / -G audio -M -p \! -r -s /usr/bin/nologin -U vlcd

现在创建 systemd 服务文件:

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

[Service]
Type=forking
User=vlcd
ExecStart=/usr/bin/vlc --daemon --syslog -I http --http-port 8090 --http-password password 
Restart=on-abort

[Install]
WantedBy=multi-user.target

启动启用 vlc.service。使用没有用户名并使用您在服务文件中输入的密码登录 http://yourmachine:8090/。

Chromecast 支持[编辑 | 编辑源代码]

Starting with 3.0 release (Vetinari branch), VLC can stream to Chromecast devices on the same network.

Install packages:

  • libmicrodns - VLC can find the Chromecast device and it shows up in Playback > Renderer menu
  • protobuf - enables streaming to the selected device in Playback > Renderer menu

Then, edit the file /etc/nsswitch.conf and change the hosts line to include mdns_minimal [NOTFOUND=return] before resolve and dns:

hosts: ... mdns_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] dns ...
注意:
  • If you experience slowdowns in resolving .local hosts try to use mdns4_minimal instead of mdns_minimal.
  • Look towards avahi for more information.

停止使用插件[编辑 | 编辑源代码]

安装 vlc-pause-click-pluginAUR, 它允许您单击 VLC 窗口中的视频,它将被暂停或恢复。这是通常预期的行为。

安装后未激活,您需要在设置中手动启用它,具体参见https://github.com/nurupo/vlc-pause-click-plugin#usage.

解决使用VLC的问题[编辑 | 编辑源代码]

更新以后视频损坏或其他问题[编辑 | 编辑源代码]

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.

启动 VLC 时出现故障[编辑 | 编辑源代码]

启动VLC时,您可能会遇到的错误,并排除微码等一般因素,可能可以解决方法是运行以下命令:

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

然后重启VLC

播放视频时出错[编辑 | 编辑源代码]

If VLC can open and play audio files, but closes when you play a video with a segfault. Then Hardware video acceleration was wrongly configured, making VLC unable to refer to graphic devices. It occurs especially when you are using different graphic cards on one computer. You can install the following dependencies to solve the problem.

For Nvidia graphic card users: install libva-vdpau-driver.

For Intel graphic card users: install libva-intel-driver.

下拉菜单中缺少图标[编辑 | 编辑源代码]

This can happen under XFCE, there will be no more icons in dropdown menus, like 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

无法打开 VDPAU 后端[编辑 | 编辑源代码]

See Hardware video acceleration#Failed to open VDPAU backend.

Since your system probably does not support VDPAU you should tell VLC to use VA-API instead, see #Hardware video acceleration.

VLC 关闭后无法再次打开[编辑 | 编辑源代码]

Manually set VLC to use the VA-API acceleration backend in Settings -> Input/Codecs. VLC seems to select VDPAU by default, which is broken for many people.

无法通过 SFTP 播放包含空格的媒体文件名[编辑 | 编辑源代码]

If VLC does not play any videos or audio files over SFTP make sure you have sshfs installed.

If it refuses to play any media files containing spaces via SFTP and always asks for authentication change the Exec line in the vlc.desktop file to:

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

具体参见 [1].

无法打开DVD[编辑 | 编辑源代码]

To be able to play DVDs via Media > Open Disc, VLC optional dependency libdvdread needs to be installed.

无法导航 DVD 菜单[编辑 | 编辑源代码]

To navigate DVD menus and play episode by episode, VLC optional dependency libdvdnav needs to be installed.

介质无法加载[编辑 | 编辑源代码]

If some RTP, RTSP, DVB-T streams or Blu-rays look like they are endlessly buffering or silently do not load, without giving an error message in the logs (e.g. IPTV from French FAI Free) install aribb24.

Wayland支持[编辑 | 编辑源代码]

默认情况下,vlc-gitAUR构建时是支持 Wayland。设置 QT_QPA_PLATFORM=Wayland 在环境变量中启用 Wayland。

具体参见Wayland#Qt

请注意,尽管 vlcAUR的PKGBUILD(目前使用 VLC 版本 3.0)中使用了 --enable-wayland build 标志,但无论如何都会使用 XWayland,因为 VLC 3 上的 Wayland 已经停止支持了。

Note that although the --enable-wayland build flag is used in the vlc PKGBUILD (which currently uses VLC version 3.0), XWayland is used anyway, as Wayland support on VLC 3 is broken.

无法连接到 RTSP[编辑 | 编辑源代码]

当连接到 RTSP 时,但是出现无法设置 rtsp 会话错误,那么请 安装 live-media.

使用流链接播放流时出现随机颜色(机翻)[编辑 | 编辑源代码]

原来的标题是Random colors when playing streams with Streamlink

安装这个依赖包 aribb24 实现

使用 AMDGPU 播放 HEVC 视频时系统无响应[编辑 | 编辑源代码]

播放使用 HEVC (H265) 编码的视频时,用户可能会遇到系统完全冻结,无法执行任何操作或关机。

这可以通过将Open GL / GLES硬件转换器的设置更改为自动以外的其他设置来解决。

具体参见 https://gitlab.freedesktop.org/drm/amd/-/issues/2113#note_1602599

参见[编辑 | 编辑源代码]