Repository navigation
quest: plan #8013's VA-API follow-ups #8098
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f591d9a
quest: plan #8013's VA-API follow-ups
kixelated 2ac70f6
Merge remote-tracking branch 'origin/main' into quest-plan/vaapi-foll…
kixelated 5667134
quest: address #8098 review threads (H.265 caller, radeonsi fallback,…
kixelated ab8b569
quest: fix pullfrog's three threads on #8098
kixelated 369764b
Merge origin/main into quest-plan/vaapi-followups
kixelated 94f787a
quest land: merge tested base
9a8179b
quest land: merge tested base
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| # [M] VA-API encode is correct on radeonsi | ||
|
|
||
| ## Goal | ||
|
|
||
| On an AMD RX 9070 (radeonsi), moq-video's VA-API H.264 encoder either | ||
| produces a stream that ffmpeg decodes, or refuses the node, so `Kind::Auto` | ||
| falls to the next H.264 encoder (OpenH264 in a build that has it; a build | ||
| without one gets `NoEncoder` naming the refused driver). Its VPP NV12 conversion carries no chroma offset, and its | ||
| rate control stays near the target bitrate. The ignored VA-API encode tests | ||
| in `rs/moq-video/src/encode/backend/vaapi.rs` pass on that card with | ||
| `MOQ_VAAPI_DEVICE` naming its node, or skip with a reason that names the | ||
| refused driver. | ||
|
|
||
| ## Plan | ||
|
|
||
| Found 2026-11-06 in [moq-dev/moq#8013](https://github.com/moq-dev/moq/pull/8013)'s | ||
| hardware run on an RX 9070 (Mesa 26.0.8, `renderD129`): 6 of 19 VA-API tests | ||
| failed, all of them H.264 encode. A 320x240 dump gives ffprobe | ||
| `Invalid data found when processing input`, and its first NAL unit has type | ||
| 0. This also reproduces on main's moq-vaapi. H.265 encode and both decoders | ||
| pass there. [moq-dev/vaapi#10](https://github.com/moq-dev/vaapi/pull/10) | ||
| also noted a chroma offset in radeonsi's VPP NV12 output and a bitrate | ||
| overshoot. | ||
|
|
||
| Decided 2026-11-06 (maintainer, /quest-unblock): ✅ keep #8013 queued, which | ||
| puts `vaapi` on by default in moq-cli and moq-transcode, and fix this in m1. | ||
| Until it lands, an AMD-only host encodes H.264 through VA-API and publishes | ||
| a stream nobody can decode; moq-c and moq-ffi already did. Not chosen: | ||
| pulling #8013 to refuse radeonsi first, or keeping `vaapi` opt-in. Also | ||
| decided: ✅ find the root cause in m1. Not chosen: m3 beside | ||
| [Vulkan Video encode on AMD](/quest/m3/vulkan-encode.md), or only a note | ||
| there. | ||
|
|
||
| - Find whether the H.264 bytes are ours. NAL type 0 at the start points at | ||
| how moq-vaapi reads the coded buffer (a segment's `bit_offset`, or more | ||
| than one segment) or at packed headers radeonsi does not take for H.264. | ||
| [moq-dev/vaapi#10](https://github.com/moq-dev/vaapi/pull/10) had to | ||
| require packed H.265 parameter sets for the same reason. Compare against | ||
| `ffmpeg -c:v h264_vaapi` on the same node. | ||
| - If it is moq-vaapi's, fix it there with a test, release the crate, and bump | ||
| `moq-vaapi` here. If it is the driver's, refuse a radeonsi node for H.264 | ||
| encode, using the driver's vendor string, so the candidate fails to open and | ||
| OpenH264 takes over. Then link the Mesa issue. | ||
| - Fix the chroma offset and the bitrate overshoot if they are ours. If the | ||
| chroma offset is the driver's VPP, skip VPP on radeonsi and convert to NV12 | ||
| before upload. If the overshoot is the driver's, refuse a radeonsi node for | ||
| that encode, as for the H.264 bytes, so `Kind::Auto` moves on. Link the | ||
| Mesa issue either way. | ||
| - Vulkan Video still replaces VA-API on AMD later; this quest does not wait | ||
| on it. | ||
|
|
||
| Public API: none. Wire: none. | ||
|
|
||
| ## Related | ||
|
|
||
| - [Vulkan Video encode on AMD](/quest/m3/vulkan-encode.md) - AMD's long-term encode path | ||
| - [VA-API renderer tests](/quest/m4/vaapi-render-tests.md) - runs the VA-API tests on each render node | ||
| - [moq-vaapi vendor sync](/quest/m3/vendor-sync/vaapi.md) - the crate's upstream record | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # [S] H.265 encodes respect the encoder's minimum size | ||
|
|
||
| ## Goal | ||
|
|
||
| An H.265 encode narrower than the hardware encoder's minimum never fails | ||
| with an opaque driver error. moq-video's encoder probe reports the driver's | ||
| minimum width and height, `Kind::Auto` passes over a hardware candidate | ||
| whose minimum the frame is below, and with no candidate left the error names | ||
| the minimum. The caller today is `moq import capture --codec h265` | ||
| (`CaptureArgs::codec`, `rs/moq-cli/src/publish.rs`). | ||
|
|
||
| ## Plan | ||
|
|
||
| Found 2026-11-06 in [moq-dev/moq#8013](https://github.com/moq-dev/moq/pull/8013). | ||
| AMD's VCN 5 (radeonsi, Mesa `si_get.c`) does not encode H.265 narrower than | ||
| 384. moq-video has no software H.265 encoder, so on an AMD-only host an | ||
| H.265 encode below that fails to open. | ||
|
|
||
| moq-transcode cannot hit this yet: its `Config` has no output codec, and | ||
| `catalog::rung_entry` (`rs/moq-transcode/src/catalog.rs`) and `Rung::encode` | ||
| (`rs/moq-transcode/src/rung.rs`) leave `encode::Config` at its H.264 | ||
| default. Adding an H.265 output to the ladder is out of this quest's scope. | ||
| Whoever adds it applies the probe's minimum per rung (the default 240p rung | ||
| is 320 wide for a 4:3 source), and a failed rung probe must fail only that | ||
| rung: today `Pipeline::new` propagates it and aborts the whole transcode. | ||
|
|
||
| Decided 2026-11-06 (maintainer, /quest-unblock): ✅ an S quest in m3. Not | ||
| chosen: folding it into [the radeonsi quest](/quest/m1/vaapi-radeonsi.md), | ||
| or dropping it. | ||
|
|
||
| Decided 2026-11-07 (maintainer, /quest-complete): ✅ narrowed to the | ||
| capture encode (`moq import capture --codec h265`), an S in m3, with H.265 | ||
| transcode output out of scope. Not chosen: making H.265 transcode output a | ||
| prerequisite inside this quest. | ||
|
|
||
| - Learn the minimum rather than hard-coding 384. libva has no minimum | ||
| picture-size attribute (only `VAConfigAttribMaxPictureWidth`/`Height`), so | ||
| it comes from the failed open or a per-driver table. Check what NVENC and | ||
| VideoToolbox report for the same case. | ||
|
|
||
| Public API: maybe a minimum size on the encoder probe in moq-video. Wire: | ||
| none. | ||
|
|
||
| ## Related | ||
|
|
||
| - [VA-API encode is correct on radeonsi](/quest/m1/vaapi-radeonsi.md) - the same AMD hardware run | ||
| - [Vulkan Video encode on AMD](/quest/m3/vulkan-encode.md) - may report a different minimum |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.