> For the complete documentation index, see [llms.txt](https://book.bsdcn.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.bsdcn.org/handbook/di-9-zhang-duo-mei-ti/9.4.-shi-pin-bo-fang-qi.md).

# 9.4.视频播放器

本节介绍了 FreeBSD Ports 中的一些可用于视频播放的软件。

**表 4. 视频播放器包**

| 名称          | 许可证     | 包                                                                               | 工具包 |
| ----------- | ------- | ------------------------------------------------------------------------------- | --- |
| mpv         | GPL 2.0 | [multimedia/mpv](https://cgit.freebsd.org/ports/tree/multimedia/mpv/)           | CLI |
| SMPlayer    | GPL 2.0 | [multimedia/smplayer](https://cgit.freebsd.org/ports/tree/multimedia/smplayer/) | Qt  |
| VLC 媒体播放器   | GPL 2.0 | [multimedia/vlc](https://cgit.freebsd.org/ports/tree/multimedia/vlc/)           | Qt  |
| Kodi (XBMC) | GPL 2.0 | [multimedia/kodi](https://cgit.freebsd.org/ports/tree/multimedia/kodi/)         | X11 |

## 9.4.1. mpv

mpv 是一款自由的命令行媒体播放器。它支持多种媒体文件格式、音频和视频编解码器以及字幕类型。mpv 可以利用所有平台上大多数硬件解码 API。

mpv 也面向视频爱好者，它具有多种高质量的放大/缩小算法，像所有设置一样，可通过配置文件控制。配置文件可通过命令行开关选择，也可基于文件夹名称等条件选择。

它还支持高质量的 HDR 到 SDR 转换，并提供精细控制，使每个人都能在任何显示器上欣赏 HDR 内容。

要安装 mpv，请执行：

```sh
# pkg install mpv
```

以下是简短的 **\~/.config/mpv/mpv.conf** 示例：

```sh
vo=gpu-next
gpu-context=wayland
hwdec=auto
screenshot-jpeg-quality=100
scale=ewa_lanczos4sharpest
dscale=ewa_lanczos4sharpest

[TTRPG]
profile-cond=path:find('ttrpg')
profile=fast
save-position-on-quit=yes

[hdr]
scale=bilinear
dscale=bilinear
dither=no
correct-downscaling=no
linear-downscaling=no
sigmoid-upscaling=no
hdr-compute-peak=yes
hdr-peak-percentile=99.995
hdr-contrast-recovery=0.30
```

* 使用新的 gpu-next 视频输出。许多功能需要此项和/或在启用时提供更高质量
* Wayland 用户在看到图形故障时应手动设置此项
* 自动检测 GPU 硬件解码是否可用并使用
* 最佳缩放算法。如果硬件不够快且视频开始丢帧则禁用
* 录制的 TTRPG 长会话视频的示例配置文件
* 仅在路径包含 ttrpg 时应用
* 使用内置的 fast 配置文件以获得最低 CPU/GPU 占用
* 适用于 iGPU 较慢但仍想欣赏 HDR 内容的用户的示例配置文件

以下是 iGPU 用户使用此示例配置观看 HDR 内容的示例：

```sh
$ mpv --profile=hdr hdr_video.mkv
```

有关 mpv 使用方法的更多示例，请参阅 mpv 参考手册。

## 9.4.2. SMPlayer

SMPlayer 旨在成为 MPlayer 的完整前端，从基本功能（如播放视频、DVD 和 VCD）到更高级的功能（如支持 MPlayer 滤镜等）。

要安装 SMPlayer，请执行：

```sh
# pkg install smplayer
```

## 9.4.3. VLC 媒体播放器

VLC 媒体播放器是一款高度可移植的多媒体播放器，支持多种音频和视频格式（如 MPEG-1、MPEG-2、MPEG-4、DivX、mp3、ogg 等），以及 DVD、VCD 和多种流媒体协议。它还可以用作服务器，通过高带宽网络在 IPv4 或 IPv6 上以单播或多播方式传输流媒体。VLC 还具备实时转码功能，可用于流媒体传输或保存到磁盘。

要安装 VLC，请执行：

```sh
# pkg install vlc
```

## 9.4.4. Kodi (XBMC)

Kodi（前身为 XBMC）是免费的开源跨平台媒体播放器和娱乐中心。它能让用户播放和查看来自本地和网络存储媒体以及互联网的多数视频、音乐、播客和其他数字媒体文件。

要安装 Kodi，请执行：

```sh
# pkg install kodi
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://book.bsdcn.org/handbook/di-9-zhang-duo-mei-ti/9.4.-shi-pin-bo-fang-qi.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
