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

參見[編輯 | 編輯原始碼]