fix(transcode): make preset libx264-only + restore quality opt-in

Two issues with the 0.9.9 preset retune:

1. applyDefaults was filling Preset="veryfast" before
   ResolveEncoderProfile got to pick the latency-biased default, so the
   "superfast" change never reached users with a freshly-generated
   config.toml — only those who left the field empty saw it.

2. The configured preset was being passed through to every encoder.
   That's only valid for libx264 (ultrafast…veryslow); NVENC uses p1-p7
   and rejects anything else, QSV uses its own subset. A user with NVENC
   + preset="veryfast" would have ffmpeg reject the argv.

Now:
- TranscodeConfig.Preset documented as libx264-only with the full
  range + advice on quality vs first-start latency.
- Default in applyDefaults is empty (was "veryfast") so the engine
  fills in "superfast" on libx264.
- ResolveEncoderProfile ignores configuredPreset for vendor encoders
  (NVENC sticks to p3, QSV to veryfast, VideoToolbox has no preset
  knob). Test cases updated to lock in this behaviour.

Users who want better quality at slower first-play should set
download.transcode.preset = "veryfast" (previous default) / "faster" /
"fast" / "medium" in their config.toml.
This commit is contained in:
Deivid Soto 2026-05-27 10:46:03 +02:00
parent 3b8d77b496
commit 0f4ad67827
5 changed files with 72 additions and 20 deletions

View file

@ -39,6 +39,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
`realtime` flag steers VideoToolbox into the low-latency code path.
- Encoder + preset selection moved into `engine.ResolveEncoderProfile` so
the same logic drives both argv construction and the log line.
- **`download.transcode.preset` is now libx264-only**. The configured preset
is honoured on software encode (libx264 vocabulary: ultrafast →
veryslow); HW backends ignore it and use vendor-specific defaults
(NVENC p3, QSV veryfast). Passing a libx264 preset to NVENC / QSV was
previously rejected by ffmpeg; the documentation now reflects what was
always the only correct usage.
- Default `download.transcode.preset` is empty (was `"veryfast"`). The
engine fills in `"superfast"` for libx264 — latency-biased. **Users who
want better quality at slower first-play should set it explicitly in
`config.toml`**: `"veryfast"` (previous default) / `"faster"` / `"fast"`
/ `"medium"`. Range documented in the TranscodeConfig struct.
## [0.9.8] - 2026-05-27