Skip to content

fix(web): recover GIF conversion from video loading and seek errors - #3451

Open
vedanth-jadhav wants to merge 1 commit into
CapSoftware:mainfrom
vedanth-jadhav:fix/web-gif-video-errors
Open

vedanth-jadhav wants to merge 1 commit into
CapSoftware:mainfrom
vedanth-jadhav:fix/web-gif-video-errors

Conversation

@vedanth-jadhav

@vedanth-jadhav vedanth-jadhav commented Oct 27, 2026 •

Copy link
Copy Markdown

The MP4-to-GIF tool waits only for loadedmetadata and seeked. If a browser cannot decode a source that Remotion can inspect, its video error leaves the converter stuck on “Converting...” with the input Blob URL retained. Frame-drawing exceptions inside the seek callback also leave its promise pending.

Wait for success or error before starting each media operation, remove both listeners on settlement, and draw frames after the seek promise resolves so exceptions reach the existing error UI. Release the input URL and unload the detached video in finally, including playback/encoder/source-assignment failures. Successful GIF output remains available.

Reproduced in native Chromium 154 through the actual mounted MediaFormatConverter and real Remotion 4.0.481/gif.js 0.2.0: a synthetic one-second 160×90 HEVC MP4 parses as h265, then Chromium reports MediaError 4 / DEMUXER_ERROR_NO_SUPPORTED_STREAMS. Before: stuck at 0%, one input URL created and none revoked. After: “Conversion failed: Your browser could not read this video for GIF conversion.”, Convert to GIF is available again, and the created input URL is revoked. The test browser uses a fresh profile and an HTTPS secure context; only Button, navigation and analytics are replaced by test shells. The decoder/parser failure is native. No live account, physical GPU or successful native GIF-encoder claim.

Validation: 15 tests pass: seven mounted failure/retry/success cases plus five existing actual-Remotion conversion tests and three selection tests. Five of the initial six new cases fail against main 8dd141d; its success control passes. The additional drawing-failure case passes after the fix. Existing 6s/24s GIF frame counts/delays remain covered. The existing GIF test gains a jsdom load stub for native cleanup.

Scoped strict TypeScript/noUncheckedIndexedAccess passes for the component, helper and new tests, resolving the actual Button/helper sources without pulling the whole UI barrel. New/helper/test Biome checks, component formatting, CI YAML parsing and git diff --check pass. The component's broader Biome check still reports the same 10 errors and four warnings on baseline and candidate (existing accessibility/any findings); no suppressions added. Full web build/typecheck not run. No dependency changes.

Native fixture reproduction: ffmpeg -f lavfi -i testsrc2=size=160x90:rate=5 -t 1 -an -c:v libx265 -preset ultrafast -x265-params pools=1:frame-threads=1:log-level=error -tag:v hvc1 hevc.mp4, then select it in /tools/convert/mp4-to-gif on a browser without HEVC decoding.

Separate from #3427, which fixes MP3 encoding in the same tool. This change is confined to GIF video waits and source cleanup.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no actionable issues were found.

Summary

GIF conversion now catches video loading and seek errors instead of leaving those waits pending.

  • GIF conversion reports video errors and releases its input resources.

Review checks were limited to source inspection; tests were not run.

Reviews (1) · Last reviewed commit: "fix(web): recover GIF conversion from vi..." · Reviewed by Greptile

@vercel

vercel Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Someone is attempting to deploy a commit to the Cap Software Inc Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
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