# 9.5 视频播放器

FreeBSD 上主要的视频播放器包括 VLC、SMPlayer 和 Kodi，均支持 pkg 安装。本节另附 mpv 在 TTY 下直接播放视频的配置方法。

## VLC

### 安装 VLC

* 使用 pkg（二进制包管理器）安装：

```sh
# pkg install vlc
```

* 或者使用 Ports（源代码包管理器）编译安装：

```sh
# cd /usr/ports/multimedia/vlc/
# make install clean
```

### 使用 VLC 播放视频

经测试，常用视频格式均能在 VLC 中正常播放。

![VLC 播放器](/files/thZEUYkymzCOGoVOx3kT)

![VLC 视频播放](/files/DJGi4qgBBIenSbX3B8Uo)

## SMPlayer

SMPlayer 是 MPlayer（一款纯命令行视频播放器）的 Qt 图形前端。

### 安装 SMPlayer

* 使用 pkg 二进制包管理器安装：

```sh
# pkg install smplayer
```

* 或者使用 Ports 源代码编译安装：

```sh
# cd /usr/ports/multimedia/smplayer/
# make install clean
```

### 使用 SMPlayer 播放视频

经测试，常用视频格式均能在 SMPlayer 播放器中正常播放。

![SMPlayer](/files/AZN8UE5HvDexlSmCJHza)

![SMPlayer](/files/q9jRvuXZezHQdogUmKG7)

![SMPlayer](/files/fEp0ll6PueglUsIQWYOy)

## Kodi

Kodi 是一款知名的开源媒体中心软件，其曾用名为 XBMC（Xbox Media Center）。

### 安装 Kodi

* 使用 pkg 二进制包管理器安装：

```sh
# pkg install kodi
```

* 或者使用 Ports 源代码编译安装：

```sh
# cd /usr/ports/multimedia/kodi/
# make install clean
```

### 为 Kodi 设置中文环境

首先打开 Kodi 主界面中的 `interface`（界面）设置选项：

![Kodi 设置界面](/files/7oo2P2rwSMONQprC9f0t)

点击 `Skin`（皮肤）选项，然后点击界面左下角的设置级别按钮，将当前的 `Basic`（简单）级别改为 `Expert`（专家）或 `Standard`（标准）级别，否则无法看到 `Fonts`（字体）等高级设置选项。随后将 `Fonts`（字体）设置为 `Arial based`，否则中文可能显示为乱码。

![Kodi 字体设置界面](/files/m5Cc2guhMm0Po5VEhmaR)

返回上一级菜单后，依次选择 `Regional`（区域）→ `Language`（语言）→ `Chinese (Simplified)`（简体中文）选项以完成语言切换。

![Kodi 语言设置界面](/files/65CDl1k3knH3yHN7r7Bl)

中文界面设置完成后的效果如下：

![Kodi 中文界面](/files/S6xoFjSHCKp2usUPayd7)

### 使用 Kodi 播放视频

经测试，常用视频格式均能在 Kodi 媒体中心中正常播放。

![Kodi 播放视频测试](/files/lDqXrQzERiraL7brMieJ)

## 附录：直接在 TTY 播放视频（mpv）

可直接在 Linux/FreeBSD 的 TTY（电传打字机，Teletypewriter，即纯文本终端）环境中使用 mpv 命令播放视频文件。

* 使用 pkg（二进制包管理器）安装：

```sh
# pkg install mpv
```

* 还可通过 Ports 源代码编译安装：

```sh
# cd /usr/ports/multimedia/mpv/
# make install clean
```

切换到 TTY 终端环境后，使用 mpv 播放器播放视频文件 `1.mp4`：

```sh
$ mpv 1.mp4
```

> **注意**
>
> 此功能依赖 DRM（Direct Rendering Manager，直接渲染管理器）图形子系统，在虚拟机环境中可能无法正常使用。


---

# Agent Instructions: 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:

```
GET https://book.bsdcn.org/di-9-zhang-duo-mei-ti-he-wai-bu-she-bei/di-9.5-jie-shi-pin-bo-fang-qi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
