Skip to content

Fix/decode early bug#505

Merged
siddharthvaddem merged 6 commits intosiddharthvaddem:mainfrom
marcgabe15:fix/decodeEarlyBug
Apr 30, 2026
Merged

Fix/decode early bug#505
siddharthvaddem merged 6 commits intosiddharthvaddem:mainfrom
marcgabe15:fix/decodeEarlyBug

Conversation

@marcgabe15
Copy link
Copy Markdown
Collaborator

@marcgabe15 marcgabe15 commented Apr 30, 2026

Pull Request Template

Description

We were getting issues because of this bug #465 . It looks like we try to stamp the duration of a video by wall clock time but it doesn't match with the actual encoded frames causing the thrown error to happen

Instead of throwing the error, instead we'll show a warning and still export the video because MediaRecorder + fix-webm-duration aren't perfect in putting the actual duration and timing

Type of Change

  • New Feature
  • Bug Fix
  • Refactor / Code Cleanup
  • Documentation Update
  • Other (please specify)

Related Issue(s)

Screenshots / Video

image

Screenshot (if applicable):

![Screenshot Description](path/to/screenshot.png)

Video (if applicable):

<video src="path/to/video.mp4" controls width="600"></video>

Testing

I've tested with a sample video I created with ffmpeg with a 4.6 second actual frame duration but 6 second container duration

Checklist

  • I have performed a self-review of my code.
  • I have added any necessary screenshots or videos.
  • I have linked related issue(s) and updated the changelog if applicable.

Thank you for contributing!

Summary by CodeRabbit

  • New Features

    • Added warning notifications during video export that inform users of non-critical issues encountered while encoding GIF or MP4 files, allowing exports to complete successfully.
  • Improvements

    • Enhanced decoder validation logic for improved export robustness and handling of edge cases.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 30, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: aaf284c5-6ab8-4b7b-8ea4-3f2795b36229

📥 Commits

Reviewing files that changed from the base of the PR and between a6fe33a and 93466fd.

⛔ Files ignored due to path filters (1)
  • tests/fixtures/sample-inflated-duration.webm is excluded by !**/*.webm
📒 Files selected for processing (5)
  • src/components/video-editor/VideoEditor.tsx
  • src/lib/exporter/gifExporter.ts
  • src/lib/exporter/streamingDecoder.ts
  • src/lib/exporter/types.ts
  • src/lib/exporter/videoExporter.ts

📝 Walkthrough

Walkthrough

This PR adds warning collection and surfacing throughout the video export pipeline. The ExportResult type now includes an optional warnings field; decoders implement onWarning callbacks to capture non-fatal issues; and the UI surfaces collected warnings to users via toast notifications instead of failing silently.

Changes

Cohort / File(s) Summary
Type definition
src/lib/exporter/types.ts
Extended ExportResult interface with optional warnings?: string[] field to carry warning messages alongside export results.
Decoder infrastructure
src/lib/exporter/streamingDecoder.ts, src/lib/exporter/gifExporter.ts, src/lib/exporter/videoExporter.ts
Implemented warning collection: added onWarning callback parameter to decodeAll, wired it into decoder pipelines, and aggregated warnings into export results. Changed early-decode handling from throwing errors to logging warnings for non-fatal cases.
UI layer
src/components/video-editor/VideoEditor.tsx
Added warning surfacing to users: when export completes with warnings, each is displayed via toast.warning() before saving media.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Suggested labels

bug

Suggested reviewers

  • siddharthvaddem

✨ warnings whisper soft instead of crash,
decoders chat their troubles with a dash,
toast pops up to say "hey, heads up friend,"
export's kinda zen now—graceful in the end. 🎬

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix/decode early bug' directly references the main change: fixing the early decode duration mismatch bug that prevents errors from being thrown.
Description check ✅ Passed The description adequately covers the bug context (#465), the change in behavior (warning instead of error), rationale, and testing approach despite some unchecked checklist items.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@marcgabe15
Copy link
Copy Markdown
Collaborator Author

Tried with Main + my branch to repro
decode-early-bug.webm

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 93466fdda1

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/lib/exporter/streamingDecoder.ts
@siddharthvaddem siddharthvaddem merged commit 884021c into siddharthvaddem:main Apr 30, 2026
11 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.

2 participants