feat(server): offer HandBrake GUI steps for rejected video uploads#3040
Merged
Conversation
- 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>
There was a problem hiding this comment.
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 tometadata.error_handbrakealongsideerror_recipevia the existing failure lifecycle. - UI: render
metadata.error_handbrakeas 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.
- 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>
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>
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



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
ffmpegre-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)vsH.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.metadata.error_handbrakevia the sameon_failure/_set_processing_errorlifecycle aserror_recipe(cleared on the next non-recipe failure). The v2 API surfaces it automatically as part ofmetadata.Checklist
🤖 Generated with Claude Code