[PR #279] [MERGED] um video: keep --preview sizes even, and refuse an odd EDL size up front #278

Closed
opened 2026-10-15 20:55:05 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/rehan-remade/universal-modder/pull/279
Author: @HEOJUNFO
Created: 10/13/2026
Status: ✅ Merged
Merged: 10/14/2026
Merged by: @rehan-remade

Base: main ← Head: fix/video-preview-even-size


📝 Commits (3)

  • 4ad6418 um video: keep --preview sizes even, and refuse an odd EDL size up front
  • 0971d1b renormalize line endings to match .gitattributes (as on main since #304)
  • 0eb945a Merge remote-tracking branch 'origin/main' into land/pr-279

📊 Changes

2 files changed (+20 additions, -1 deletions)

View changed files

📝 tests/test_um.py (+16 -0)
📝 um/video.py (+4 -1)

📄 Description

What: um video compile --preview crashed on a 4:5 edit. The preview size is now kept even, and an odd size in the EDL stops with a clear message.

Half of "size": [1080, 1350] is 540x675. libx264 won't encode an odd height in yuv420p, so the first segment failed:

um: ffmpeg failed:
...
[libx264 @ 0x...] height not divisible by 2 (540x675)
  • --preview halves each side and rounds down to an even number, so 1080x1350 previews at 540x674. Sizes that are multiples of 4 (1920x1080 → 960x540) don't change.
  • An odd size in the EDL (say 1080x1351) used to fail the same way deep inside ffmpeg. It now stops before rendering: size 1080x1351: width and height must be even (yuv420p H.264 refuses odd sizes).
  • test_compile_preview_keeps_size_even compiles a 1080x1350 EDL with preview=True, checks that the output is 540x674, and checks that a 1080x1351 EDL exits. It fails on main with the libx264 error above.

Checklist

  • uv run --with pytest pytest -q tests passes (code): 141 passed, 1 skipped (macOS, ffmpeg 9.0.2)
  • um kb index regenerated (field notes): n/a, code only
  • no game files, extracted assets, decompiled code dumps or secrets
  • nothing that cheats other players or bypasses anti-cheat / DRM / ownership checks
  • versions, verification and what was NOT verified are written down. Not tested: Windows, or ffmpeg older than 9.0.
  • authored by (agent + model / human): Claude Code (Claude Opus 5.5) with @HEOJUNFO

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/rehan-remade/universal-modder/pull/279 **Author:** [@HEOJUNFO](https://github.com/HEOJUNFO) **Created:** 10/13/2026 **Status:** ✅ Merged **Merged:** 10/14/2026 **Merged by:** [@rehan-remade](https://github.com/rehan-remade) **Base:** `main` ← **Head:** `fix/video-preview-even-size` --- ### 📝 Commits (3) - [`4ad6418`](https://github.com/rehan-remade/universal-modder/commit/4ad6418a66666282932c4932ab8e090abe6079f5) um video: keep --preview sizes even, and refuse an odd EDL size up front - [`0971d1b`](https://github.com/rehan-remade/universal-modder/commit/0971d1bd9abd15c94a8537d9cf88db131c7ea26f) renormalize line endings to match .gitattributes (as on main since #304) - [`0eb945a`](https://github.com/rehan-remade/universal-modder/commit/0eb945acbadf82fc5fe9f4e88bf425828e1c4603) Merge remote-tracking branch 'origin/main' into land/pr-279 ### 📊 Changes **2 files changed** (+20 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_um.py` (+16 -0) 📝 `um/video.py` (+4 -1) </details> ### 📄 Description **What:** `um video compile --preview` crashed on a 4:5 edit. The preview size is now kept even, and an odd `size` in the EDL stops with a clear message. Half of `"size": [1080, 1350]` is 540x675. libx264 won't encode an odd height in yuv420p, so the first segment failed: ``` um: ffmpeg failed: ... [libx264 @ 0x...] height not divisible by 2 (540x675) ``` - `--preview` halves each side and rounds down to an even number, so 1080x1350 previews at 540x674. Sizes that are multiples of 4 (1920x1080 → 960x540) don't change. - An odd `size` in the EDL (say 1080x1351) used to fail the same way deep inside ffmpeg. It now stops before rendering: `size 1080x1351: width and height must be even (yuv420p H.264 refuses odd sizes)`. - `test_compile_preview_keeps_size_even` compiles a 1080x1350 EDL with `preview=True`, checks that the output is 540x674, and checks that a 1080x1351 EDL exits. It fails on `main` with the libx264 error above. **Checklist** - [x] `uv run --with pytest pytest -q tests` passes (code): 141 passed, 1 skipped (macOS, ffmpeg 9.0.2) - [ ] `um kb index` regenerated (field notes): n/a, code only - [x] no game files, extracted assets, decompiled code dumps or secrets - [x] nothing that cheats other players or bypasses anti-cheat / DRM / ownership checks - [x] versions, verification and what was NOT verified are written down. Not tested: Windows, or ffmpeg older than 9.0. - [x] authored by (agent + model / human): Claude Code (Claude Opus 5.5) with @HEOJUNFO 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-15 20:55:05 +00:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rehan-remade/universal-modder#278
No description provided.