Skip to content

Commit e7e4f30

Browse files
committed
Clarify hardware acceleration docs
1 parent 509b1ff commit e7e4f30

3 files changed

Lines changed: 15 additions & 12 deletions

File tree

README.en.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ It is intentionally narrow: normal API traffic is forwarded to the upstream serv
1919

2020
- Native Linux-friendly Go binary.
2121
- Transparent reverse proxy for ordinary Emby/Jellyfin requests.
22-
- Client profile matching by `User-Agent` and `X-Emby-Authorization`.
22+
- Client profile matching by `User-Agent`, `X-Emby-Authorization`, and `X-MediaBrowser-Token`.
2323
- PlaybackInfo rewriting for matched profiles.
2424
- Local FFmpeg HLS sessions under `/streambridge/transcode/`.
2525
- Audio track selection through Emby `AudioStreamIndex`, with local transcode restart on audio changes.
2626
- Playback lifecycle tracking through Emby `/Sessions/Playing*` check-ins plus HLS access.
2727
- Conservative output target: H.264 video, AAC audio, HLS MPEG-TS segments.
28-
- Video output is capped at 1920x1080 and keeps aspect ratio.
28+
- Software transcoding caps video output at 1920x1080 and keeps aspect ratio; VAAPI mode does not scale.
2929
- PlaybackInfo rewrite prewarms the transcode session before the first playlist request.
3030
- FFmpeg uses low-latency startup and GOP settings to cut first-segment delay.
3131

@@ -72,8 +72,9 @@ Edit `docker/config/config.local.json` before starting:
7272
- set `upstream.url` to your Emby or Jellyfin server
7373
- set `server.public_url` if clients reach the proxy through another reverse proxy
7474
- leave `server.debug` as `false` for concise logs, or set it to `true` for detailed diagnostics
75+
- leave `transcode.hardware_decode` as `""` to disable hardware acceleration and use CPU transcoding
7576
- set `transcode.hardware_decode` to `vaapi` on Linux hosts with Intel or AMD `/dev/dri` VAAPI support
76-
- VAAPI mode first tries `vaapi-full` (`scale_vaapi` GPU scaling plus `h264_vaapi` encoding), then falls back to `vaapi-encode` (CPU scaling plus `h264_vaapi`) when GPU scaling is unsupported
77+
- the current VAAPI path uses hardware decode plus `h264_vaapi` hardware encoding and does not add a scale filter
7778
- startup will probe VAAPI availability, including device initialization and `h264_vaapi`, and fail startup if the device, driver, or ffmpeg support is missing
7879

7980
Update `docker/docker-compose.yml` to mount the local config file if you use `config.local.json`:
@@ -136,8 +137,8 @@ Copy `config.example.json` and change the upstream URL:
136137

137138
Leave `public_url` empty when clients connect directly to Emby-Transcoder. Set it when Emby-Transcoder sits behind another reverse proxy.
138139
Leave `debug` as `false` for concise action-level logs. Set it to `true` when you want detailed `TRACE_SWITCH` and request-level diagnostics.
139-
Set `hardware_decode` to `vaapi` to enable VAAPI hardware transcoding. The default `hardware_device` is `/dev/dri/renderD128`.
140-
Startup prefers `vaapi-full`; if `scale_vaapi` fails, it falls back to `vaapi-encode` so H.264 encoding still stays on the GPU. If the device, driver, or `h264_vaapi` probe fails, startup stops with an error.
140+
Leave `hardware_decode` as `""` to disable hardware acceleration and use CPU transcoding. Set it to `vaapi` to enable VAAPI hardware transcoding. The default `hardware_device` is `/dev/dri/renderD128`.
141+
The current VAAPI path uses hardware decode plus `h264_vaapi` hardware encoding and does not add a scale filter. If the device, driver, or `h264_vaapi` probe fails, startup stops with an error.
141142

142143
## Transcode Lifecycle
143144

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ Emby-Transcoder 是一个轻量级 Go 反向代理,为 Emby 和 Jellyfin 客
1919

2020
- 原生 Go 二进制,适合 Linux 部署。
2121
- 普通 Emby/Jellyfin 请求透明反向代理。
22-
-`User-Agent``X-Emby-Authorization` 匹配客户端配置。
22+
-`User-Agent``X-Emby-Authorization``X-MediaBrowser-Token` 匹配客户端配置。
2323
- 对命中的客户端重写 PlaybackInfo。
2424
- 本地 FFmpeg HLS 会话路径为 `/streambridge/transcode/`
2525
- 支持通过 Emby `AudioStreamIndex` 选择音轨,切换音轨时会重启本地转码。
2626
- 通过 Emby `/Sessions/Playing*` check-in 和 HLS 访问跟踪播放生命周期。
2727
- 输出目标保守固定为 H.264 视频、AAC 音频、HLS MPEG-TS 分片。
28-
- 视频输出限制到 1920x1080,并保持原始宽高比。
28+
- 软件转码会把视频输出限制到 1920x1080,并保持原始宽高比;VAAPI 模式不做缩放
2929
- PlaybackInfo 重写时会预热转码会话,减少首次 playlist 请求等待。
3030
- FFmpeg 使用低延迟启动和 GOP 参数,降低首分片延迟。
3131

@@ -74,8 +74,9 @@ cp config/config.json config/config.local.json
7474
-`upstream.url` 改成你的 Emby 或 Jellyfin 地址。
7575
- 如果客户端通过另一层反向代理访问本服务,设置 `server.public_url`
7676
- `server.debug` 默认保持 `false`,日志更简洁;需要诊断时改成 `true`
77+
- `transcode.hardware_decode` 保持 `""` 表示不使用硬件加速,走 CPU 转码。
7778
- Linux 主机有 Intel 或 AMD `/dev/dri` VAAPI 支持时,可将 `transcode.hardware_decode` 设置为 `vaapi`
78-
- VAAPI 会先尝试 `vaapi-full``scale_vaapi` GPU 缩放加 `h264_vaapi` 编码),不支持 GPU 缩放时回退到 `vaapi-encode`(CPU 缩放加 `h264_vaapi` 编码)
79+
- 当前 VAAPI 模式使用硬件解码加 `h264_vaapi` 硬件编码,不再插入缩放过滤器
7980
- 启动时会探测 VAAPI 可用性,包括设备初始化和 `h264_vaapi`;设备、驱动或 ffmpeg 支持缺失时会启动失败。
8081

8182
如果使用 `config.local.json`,需要把 `docker/docker-compose.yml` 的挂载改成本地配置文件:
@@ -140,9 +141,9 @@ go build ./cmd/emby-transcoder
140141

141142
`debug` 保持 `false` 时只输出动作级日志;需要 `TRACE_SWITCH` 和请求级诊断时设置为 `true`
142143

143-
设置 `hardware_decode` `vaapi` 可启用 VAAPI 硬件转码,默认设备是 `/dev/dri/renderD128`
144+
`hardware_decode` 保持 `""` 表示不使用硬件加速,走 CPU 转码。设置为 `vaapi` 可启用 VAAPI 硬件转码,默认设备是 `/dev/dri/renderD128`
144145

145-
启动时优先使用 `vaapi-full`;如果 `scale_vaapi` 失败,会回退到 `vaapi-encode`,仍然使用 GPU 做 H.264 编码。如果设备、驱动或 `h264_vaapi` 探测失败,服务会停止启动。
146+
当前 VAAPI 模式使用硬件解码加 `h264_vaapi` 硬件编码,不再插入缩放过滤器。如果设备、驱动或 `h264_vaapi` 探测失败,服务会停止启动。
146147

147148
## 转码生命周期
148149

docker/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@ Edit `config/config.json` before startup, or copy it to `config/config.local.jso
2323
- set `upstream.url` to your Emby or Jellyfin server
2424
- set `server.public_url` if clients reach the proxy through another reverse proxy
2525
- set `server.debug` to `true` when you need detailed diagnostics
26+
- leave `transcode.hardware_decode` as `""` to disable hardware acceleration and use CPU transcoding
2627
- set `transcode.hardware_decode` to `vaapi` to use Intel or AMD VAAPI through `/dev/dri`
27-
- VAAPI mode first tries `vaapi-full` (`scale_vaapi` GPU scaling plus `h264_vaapi` encoding), then falls back to `vaapi-encode` (CPU scaling plus `h264_vaapi`) when GPU scaling is unsupported
28+
- VAAPI mode uses hardware decode plus `h264_vaapi` hardware encoding and does not add a scale filter
2829
- startup probes VAAPI support, including device initialization and `h264_vaapi`, and fails startup when the device, driver, or ffmpeg support is unavailable
2930
- the image includes common Intel and AMD VAAPI userspace drivers plus `vainfo`
30-
- video output is capped at 1920x1080 while preserving aspect ratio
31+
- software transcoding caps video output at 1920x1080 while preserving aspect ratio; VAAPI mode does not scale
3132
- `transcode.segment_seconds` controls HLS segment duration; default `2` balances startup latency with segment count
3233
- playbackinfo rewrites prewarm the transcode session before the first playlist request
3334
- ffmpeg runs with low-latency startup and GOP settings to reduce first-segment delay

0 commit comments

Comments
 (0)