Skip to content

Comments

@remotion/renderer: Make renderMedia() and renderStill() return MIME types#6611

Merged
JonnyBurger merged 6 commits intomainfrom
add-mimetype-to-render-results
Feb 20, 2026
Merged

@remotion/renderer: Make renderMedia() and renderStill() return MIME types#6611
JonnyBurger merged 6 commits intomainfrom
add-mimetype-to-render-results

Conversation

@JonnyBurger
Copy link
Member

Summary

  • Adds a mimeType field to the return values of renderMedia() and renderStill()
  • Uses the existing mimeLookup() utility to derive the MIME type from the output file extension
  • Updates docs for both renderMedia() and renderStill() to document the new field

Test plan

  • Verify renderMedia() returns correct MIME types (e.g. video/mp4, video/webm)
  • Verify renderStill() returns correct MIME types (e.g. image/png, image/jpeg)
  • Verify fallback to application/octet-stream for unknown extensions

🤖 Generated with Claude Code

…till() return values

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 20, 2026 10:01
@vercel
Copy link
Contributor

vercel bot commented Feb 20, 2026

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

Project Deployment Actions Updated (UTC)
bugs Ready Ready Preview, Comment Feb 20, 2026 10:23am
remotion Ready Ready Preview, Comment Feb 20, 2026 10:23am

Request Review

Copy link
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.

Clean, well-scoped change. Implementation is correct — mimeLookup handles all codec extensions and still image formats properly, and the || 'application/octet-stream' fallback correctly covers the false return from mimeLookup. One minor docs suggestion inline.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow runpullfrog.com𝕏

Copy link
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.

Low urgency. The implementation is functional and handles the common cases correctly. One edge case worth considering: renderMedia derives the MIME type from the codec's default extension rather than the actual output filename, which could return a mismatched MIME type when users specify non-default extensions (e.g., output.mkv for h264+aac would return video/mp4 instead of video/x-matroska).

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow runpullfrog.com𝕏

path.extname('.mp4') returns '' (treated as dotfile), so prefix
with 'file.' to ensure correct extension extraction.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds a mimeType field to the return values of both renderMedia() and renderStill() functions in the @remotion/renderer package. The MIME type is automatically derived from the output file format using the existing mimeLookup() utility function, with a fallback to 'application/octet-stream' for unrecognized formats.

Changes:

  • Added mimeType: string field to RenderStillReturnValue type definition
  • Added mimeType: string field to RenderMediaResult type definition
  • Updated documentation for both functions to describe the new return value field

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
packages/renderer/src/render-still.ts Added mimeType field to return type, implemented using mimeLookup(imageFormat)
packages/renderer/src/render-media.ts Added mimeType field to return type, implemented using mimeLookup(getFileExtensionFromCodec(codec, audioCodec))
packages/docs/docs/renderer/render-still.mdx Documented the new mimeType return value field with examples
packages/docs/docs/renderer/render-media.mdx Documented the new mimeType return value field with examples

@JonnyBurger JonnyBurger changed the title @remotion/renderer: Add mimeType field to renderMedia() and renderStill() return values @remotion/renderer: Make renderMedia() and renderStill() return MIME types Feb 20, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@JonnyBurger JonnyBurger merged commit 09492ec into main Feb 20, 2026
14 checks passed
@JonnyBurger JonnyBurger deleted the add-mimetype-to-render-results branch February 20, 2026 10:32
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