Skip to content

@remotion/web-renderer: Validate container and codec for transparent videos#6955

Merged
JonnyBurger merged 1 commit intomainfrom
feature/transparent-video-validation
Apr 1, 2026
Merged

@remotion/web-renderer: Validate container and codec for transparent videos#6955
JonnyBurger merged 1 commit intomainfrom
feature/transparent-video-validation

Conversation

@JonnyBurger
Copy link
Copy Markdown
Member

Summary

  • Throw an error if transparent: true is used with a container other than "webm" or "mkv"
  • Throw an error if transparent: true is used with a codec other than "vp8" or "vp9"
  • Updated docs for the transparent option to document supported containers and codecs

Test plan

  • Verify renderMediaOnWeb({ transparent: true, container: 'webm' }) works
  • Verify renderMediaOnWeb({ transparent: true, container: 'mp4' }) throws
  • Verify renderMediaOnWeb({ transparent: true, videoCodec: 'h264', container: 'mkv' }) throws
  • Verify renderMediaOnWeb({ transparent: true, videoCodec: 'vp9', container: 'webm' }) works

🤖 Generated with Claude Code

…t videos

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Apr 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
bugs Ready Ready Preview, Comment Apr 1, 2026 8:24am
remotion Ready Ready Preview, Comment Apr 1, 2026 8:24am

Request Review

@pullfrog
Copy link
Copy Markdown
Contributor

pullfrog bot commented Apr 1, 2026

Reviewed PR #6955. Found one actionable issue: the codec validation at line 218 will produce a misleading error when using container: 'mkv' without an explicit videoCodec, because mkv's default codec is h264 (incompatible with transparency). Review posted.

Task list (3/3 completed)
  • Read the diff and understand the changes
  • Investigate surrounding code for context (error patterns, codec/container types)
  • Draft review and submit or approve

Pullfrog  | View workflow run | Triggered by Pullfrog | Using Big Pickle (free) | 𝕏

Copy link
Copy Markdown
Contributor

@pullfrog pullfrog bot left a comment

Choose a reason for hiding this comment

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

The container validation is correct, but the codec validation has a gap that will produce a confusing error for mkv users who don't explicitly set a codec.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using Big Pickle (free) | 𝕏

);
}

if (codec && codec !== 'vp8' && codec !== 'vp9') {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

getDefaultVideoCodecForContainer('mkv') returns 'h264' (line 113 of mediabunny-mappings.ts), so calling renderMediaOnWeb({ transparent: true, container: 'mkv' }) without an explicit videoCodec will hit this branch and throw an error telling the user to "remove it to use the default" — but the default itself (h264) is the problem.

Two options:

  1. Check codec against the user-supplied options.videoCodec (i.e. only reject when the user explicitly passed an incompatible codec) and silently override the default to vp8/vp9 when transparent is true.
  2. Accept the current behavior but fix the error message to not suggest removing the codec option, since the default for mkv is incompatible.

@JonnyBurger JonnyBurger merged commit a697a5c into main Apr 1, 2026
19 of 20 checks passed
@JonnyBurger JonnyBurger deleted the feature/transparent-video-validation branch April 1, 2026 10:02
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