Skip to content

feat(server): offer HandBrake GUI steps for rejected video uploads#3040

Merged
vpetersson merged 4 commits into
masterfrom
worktree-adaptive-drifting-bee
Jun 9, 2026
Merged

feat(server): offer HandBrake GUI steps for rejected video uploads#3040
vpetersson merged 4 commits into
masterfrom
worktree-adaptive-drifting-bee

Conversation

@vpetersson

Copy link
Copy Markdown
Contributor

Issues Fixed

No associated issue. Improves the operator experience when a video upload is rejected because the board can't hardware-decode its codec (or the resolution exceeds the low-RAM 1080p cap).

Description

Until now, a rejected video upload surfaced an ffmpeg re-encode command in the Edit Asset modal — useful, but only for operators comfortable with a terminal. This adds a graphical alternative alongside it.

  • _handbrake_steps() generates point-and-click HandBrake steps whose codec/resolution choices mirror the existing ffmpeg recipe exactly (H.264 (x264) vs H.265 (x265), plus a 1080p Resolution-Limit step when the low-RAM cap applies). Returns no steps for an unrecognised board with no HW-decode target, matching the recipe.
  • The steps persist to metadata.error_handbrake via the same on_failure / _set_processing_error lifecycle as error_recipe (cleared on the next non-recipe failure). The v2 API surfaces it automatically as part of metadata.
  • The Edit Asset modal renders them as a numbered list under a "Prefer a graphical app?" heading with a link to handbrake.fr.

Checklist

  • I have performed a self-review of my own code.
  • New and existing unit tests pass locally and on CI with my changes.
  • I have done an end-to-end test for Raspberry Pi devices.
  • I have tested my changes for x86 devices.
  • I added a documentation for the changes I have made (when necessary).

🤖 Generated with Claude Code

- Add _handbrake_steps mirroring the ffmpeg recipe's codec/1080p choices
- Persist the steps to metadata.error_handbrake on rejection
- Render them as a numbered list with a handbrake.fr link in the modal

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vpetersson vpetersson requested a review from a team as a code owner June 9, 2026 06:30
@vpetersson vpetersson self-assigned this Jun 9, 2026
@vpetersson vpetersson requested a review from Copilot June 9, 2026 06:30
Comment thread tests/test_processing.py Fixed
Comment thread tests/test_processing.py Fixed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a GUI-friendly alternative to the existing ffmpeg “re-encode recipe” guidance when video uploads are rejected due to unsupported codec / low-RAM 1080p cap, by generating and persisting HandBrake steps and rendering them in the Edit Asset modal.

Changes:

  • Server: generate HandBrake step lists (_handbrake_steps) and persist them to metadata.error_handbrake alongside error_recipe via the existing failure lifecycle.
  • UI: render metadata.error_handbrake as a numbered list under a “Prefer a graphical app?” heading with a HandBrake link.
  • Tests: extend processing tests to validate HandBrake step generation, persistence, and stale-clear behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/anthias_server/processing.py Generates HandBrake steps; persists/clears metadata.error_handbrake; threads it through UnsupportedVideoCodecError and on_failure.
src/anthias_server/app/templates/_asset_modal.html Renders HandBrake steps in the Edit Asset modal when present in metadata.
src/anthias_server/app/static/sass/_styles.scss Styles the HandBrake steps block within the failure banner.
tests/test_processing.py Adds coverage for HandBrake steps (generation + persistence + stale clearing).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/anthias_server/processing.py Outdated
Comment thread src/anthias_server/processing.py Outdated
Comment thread tests/test_processing.py
- Lead with the stock "Fast 1080p30" preset (H.264 MP4, 1080p cap)
- HEVC boards just flip Video Encoder to "H.265 (x265)"
- Spell out source pick, Save As/Browse, and Start Encode
- Drop the cap arg: the 1080p preset is the low-RAM fix too

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread tests/test_processing.py Fixed
vpetersson and others added 2 commits June 9, 2026 06:43
Reference processing.HANDBRAKE_URL instead of a duplicated URL literal
so CodeQL stops flagging the assertion as incomplete-URL-substring
sanitization (false positive in a test containment check).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Reword final step: upload as a new asset (the Edit modal has no
  upload control)
- Rename stale-clear test to mention error_handbrake too

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Jun 9, 2026

Copy link
Copy Markdown

@vpetersson vpetersson merged commit 8c6cfaf into master Jun 9, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants