Skip to content

fix(ios): prevent compressVideo hang on writer failure and reject on reader failure (#5) - #8

Merged
thangdevalone merged 1 commit into
mainfrom
fix/5-compress-video-writer-failure
Oct 7, 2026
Merged

thangdevalone merged 1 commit into
mainfrom
fix/5-compress-video-writer-failure

Conversation

@thangdevalone

Copy link
Copy Markdown
Owner

Closes #5

Summary

  • Checks append(...) boolean returns and writer.status in both video and audio loops.
  • Cancels reader and marks inputs as finished on writer failure, guaranteeing group.leave() is called so JS promise never hangs.
  • Detects reader.status == .failed and rejects with reader.error instead of succeeding with a truncated file.
  • Throttles onProgress to 1% intervals to prevent flooding DispatchQueue.main.
  • Initializes CIContext(options: [.cacheIntermediates: false]) to avoid memory bloat during per-frame resize.

@thangdevalone thangdevalone self-assigned this Oct 7, 2026
@thangdevalone
thangdevalone merged commit ac9d450 into main Oct 7, 2026
3 checks passed
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.

iOS: compressVideo({ bitrate }) hangs forever on writer failure; reader failure returns a truncated file as success

1 participant