Repository navigation
Render each GAM video from the version that best matches the output - #34
Merged
Merged
Conversation
GAM can now hold standard-resolution versions of a video (davior/gam#56). A render asks for them and reads the smallest file that is still at least as sharp as the frame shows it: - a 1080p render of a 4K original reads its 1080p version, and a preview its 480p, for a fraction of the bytes to fetch and decode; - the next size up when the exact one was never made, and the original when nothing is big enough; - a shot cropped to fill the frame needs both edges to cover it, so a 16:9 video cropped into a 9:16 frame still reads the original, while one fitted inside the same frame can use a far smaller file; - a clip reads its parent's versions, which share its timeline; - a GAM without versions (a 404), or a failed call, renders the original as before. Versions are cached beside the original under their own key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V1geD6HjkZNo9XQSHdawSb
main (#33) refuses a file GAM reports as over RENDER_MAX_FILE_MB before downloading it; this branch chooses between the original and its versions. The check now runs after the choice, on the chosen file, and a version's own size counts as known. So a 4K original over the limit still renders when a version that fits was made, and an oversized version is refused before it downloads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V1geD6HjkZNo9XQSHdawSb
davior
marked this pull request as ready for review
October 29, 2026 09:52
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.
What
GAM can now hold standard-resolution versions of a video (davior/gam#56, recorded here as GAM-10). When a render resolves its media, it now asks GAM for each video's versions and reads the smallest file that is still at least as sharp as the frame shows it (
render/media.py::pick_source).crophas to cover the frame, so both edges must reach it. A 16:9 video cropped into a 9:16 frame is shown 1920 tall, so it still reads the 4K original.blurandpadonly have to fit inside the frame, so either edge reaching it is enough. The same video fitted into that frame is shown 1080 wide, so the 720p (1280 wide) will do.<id>@1080) next to the original.RENDER_MAX_FILE_MBis checked after the file is chosen, against that file's own size. A 4K original over the limit still renders when a version that fits exists, and an oversized version is refused before it downloads.The editor's in-browser players still stream the original. Only renders change.
Tests
tests/test_render_versions.py(13 tests):/versionsroute.pytest -q778 passed. No frontend changes.🤖 Generated with Claude Code
https://claude.ai/code/session_01V1geD6HjkZNo9XQSHdawSb