Skip to content

fix(openfilm): handle mixed PNG alpha on FFmpeg 9.1 and deflake caption test - #1

Closed
Rehan-nawroz wants to merge 1 commit into
Flowthread:mainfrom
Rehan-nawroz:fix/ci-ffmpeg-91-alpha-and-caption-flake
Closed

Rehan-nawroz wants to merge 1 commit into
Flowthread:mainfrom
Rehan-nawroz:fix/ci-ffmpeg-91-alpha-and-caption-flake

Conversation

@Rehan-nawroz

Copy link
Copy Markdown

Fixes the two failures from CI run 44950194416: Windows shard 1/3 and macOS shard 1/3. Both failed on the first attempt and on retry.

Windows: transparent ProRes/WebM export failed on FFmpeg 9.1

What broke

transparent ProRes and WebM blur keeps nearly transparent white from becoming a luminous blue edge failed with:

[Parsed_crop_0] Frame size or format changed without filter graph reinitialization
[vf#0:0] Error while filtering: Invalid argument
'failed' !== 'done'

Root cause

  • CI's choco install ffmpeg now installs FFmpeg 9.1.0.
  • Chromium omits PNG's alpha plane for an entirely opaque frame. A render that has transparency on some frames therefore sends rgba and then rgb24 through the image2pipe stream.
  • Alpha exports pass -reinit_filter 0 on purpose, so a format change cannot rebuild the graph without resetting tmix and select.
  • FFmpeg 9.1 errors when a frame's format changes and the receiving filter does not declare dynamic frame format support.
  • crop supports dynamic frame size, but not dynamic format, so it is the filter that throws.

FFmpeg 9.0.2 only warns, which is why this passed locally.

Fix

For PNG input, normalize the frame format before the crop:

scale=iw:ih:flags=neighbor,format=rgba,crop=trunc(iw/2)*2:trunc(ih/2)*2:0:0

scale supports dynamic frame params. The 1:1 nearest-neighbour scale resamples nothing; it only gives rgb24 frames an opaque alpha plane and makes every frame RGBA before the crop. The final pixel-format conversion stays after the crop, as before.

macOS: caption group move timed out

What broke

unlocked caption tracks move with a mixed selection, with one undo for media and captions failed with:

AssertionError: 'select all picks both media clips and all unlocked captions'
duration: 19.7 s and 23.8 s

Root cause

  • The test waits for 185 selection frames after Cmd+A: 183 cues and 2 media clips.
  • It had a 15 s budget, but the failing macOS shard was roughly twice as slow as the other runners and the test took ~20–24 s.
  • It waited for all 183 cues before Cmd+A, but not for the second media clip, so the selection could be built from a half-loaded timeline.
  • selected was a dependency of the timeline keydown effect, so every clip click rebuilt the global listener. A Cmd+A arriving during that swap could be lost.

Fix

  • Wait for both media clips before pressing Cmd+A.
  • Raise the wait budget from 15 s to 60 s.
  • Raise the test timeout from 90 s to 180 s.
  • Read the selection through the existing selectedRef and remove selected from the keydown effect dependencies, so the listener stays registered across picks.

Verification

  • clip-export-regressions.test.mjs: 10/10 pass on FFmpeg 9.1.0 (the essentials build CI installs).
  • Same suite: 10/10 pass on FFmpeg 9.0.2, confirming no regression.
  • caption-group-move.test.mjs: passes locally in ~5 s.
  • pnpm typecheck: all workspace packages pass.
  • pnpm --filter openfilm build:ui: passes.
  • pnpm audit:public --no-secrets: no findings.
  • git diff --check: clean.

The macOS fix removes the hard 15 s deadline and both race windows, but the next macOS CI run is the real confirmation under runner load.

…on test

Fix the two failures on main in CI run 44950194416.

Windows: transparent ProRes/WebM export failed on FFmpeg 9.1

Chromium omits PNG's alpha plane for an entirely opaque frame, so a
render that has transparency on some frames sends rgba followed by
rgb24. Alpha exports pass -reinit_filter 0 on purpose, to keep tmix and
select from being reset, so FFmpeg cannot rebuild the graph. FFmpeg 9.1
now errors when crop receives a format change:

  Frame size or format changed without filter graph reinitialization

crop supports dynamic frame size but not dynamic frame format. scale
does support both, so normalize PNG frames before the crop with:

  scale=iw:ih:flags=neighbor,format=rgba

The scale is 1:1 with nearest neighbours, so it resamples nothing; it
only gives rgb24 frames an opaque alpha plane and makes every frame
rgba before the crop. The final pixel-format conversion stays after the
crop, as before.

Verified with clip-export-regressions.test.mjs: 10/10 pass on FFmpeg
9.1.0 (the same essentials build CI installs) and 10/10 on 9.0.2.

macOS: caption group move timed out

The test waits for 185 selection frames after Cmd+A: 183 caption cues
and 2 media clips. It had a 15 s budget, but the failing macOS runs took
19.7 s and 23.8 s on a shard that was about twice as slow as the other
runners. It also pressed Cmd+A after waiting only for the cues, not for
the second media clip, so select-all could be built from a half-loaded
timeline. Finally, selected was a dependency of the timeline keydown
effect, so every clip click rebuilt the global listener and a Cmd+A
arriving during that swap could be lost.

Wait for both media clips before Cmd+A, raise the wait budget to 60 s
and the test timeout to 180 s, and read the selection through the
existing selectedRef so the listener stays registered across picks.

Verified locally (caption test passes in about 5 s); the next macOS CI
run confirms the runner-load behaviour.
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.

1 participant