Files
nexus/wiki/concepts/硬件转码.md

46 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "硬件转码"
type: concept
tags: [video, jellyfin, transcoding, gpu, quicksync]
---
## 定义
硬件转码是利用 GPU 或专用视频处理芯片Intel QuickSync/NVIDIA NVENC/AMD VAAPI替代 CPU 执行视频格式转换的技术。[[Jellyfin]] 部署中的核心优化手段。
## 工作原理
传统软件转码完全依赖 CPU
- H.264/H.265/VP9 → 实时转码需要多核 CPU 高负载
- 1080p@60fps 可能需要 8+ 核心
硬件转码将视频编解码任务卸载到专用单元:
- **Intel QuickSync**:集成于 Intel CPUHaswell 及以后),性能远超同代 CPU 软解
- **NVIDIA NVENC**:独立显卡或 RTX 系列 GPU效率最高
- **AMD VAAPI**AMD GPU 支持
## Jellyfin 中的配置
```yaml
devices:
- /dev/dri:/dev/dri # 挂载 Intel GPU 设备到容器
```
## 性能对比
| 方式 | 1080p@60fps CPU 占用 | 延迟 | 功耗 |
|------|---------------------|------|------|
| CPU 软解 | ~300%8核以上 | 高 | >100W |
| Intel QuickSync | ~20% | 低 | <20W |
| NVIDIA NVENC | <10% | 极低 | 视 GPU 型号 |
## 在媒体服务器中的价值
- 支持更多客户端同时播放不同格式视频
- 移动设备(带宽有限)可请求转码后的低码率流
- 老旧设备无法硬解 H.265 时,自动降级转码为 H.264
## Aliases
- Hardware Transcoding
- Intel QuickSync
- NVENC
- VAAPI
- 硬件加速转码