Skip to content

Allow to set per-composition render defaults #2487

@JonnyBurger

Description

@JonnyBurger

Currently the codec (any many other options) are determined by a few factors:

  1. Specified in the render dialog in the Remotion Studio?
  2. Specified as a CLI flag?
  3. Passed explicitly to renderMedia()?
  4. Specified in the config file?
  5. Fallback: Default codec

The idea is to add another way that allows per-default configuration, starting with codec

<Composition calculateMetadata={() => {
	return {defaultCodec: "vp8"}
}}/>

This will have a higher priority than the config file, but less priority than explicitly passing the option to renderMedia().

The VideoConfig type should be expanded with a defaultConfig field:

export type VideoConfig = {
width: number;
height: number;
fps: number;
durationInFrames: number;

This is a good first step and TypeScript should reveal the places where you need to implement additional functionality

Acceptance criteria

  • Make the composition get rendered with this codec if nothing with higher priority was specified.
  • In the Remotion Studio, when rendering, the codec should be preselected in the modal but overridden.
  • Logs should also tell when this was used for resolution (extend this here)
  • Add it to the calculateMetadata() docs

Bounty

💎 This issue is part of Hacktoberfest and has a bounty on it!

🎃 Hacktoberfest rules

  • You can only work on 1 issue at a time.
  • Only 1 person can work on the same issue.
  • We explicitly assign a developer. Don’t work on an issue if we do not assign you.
  • First-time contributors will get preferential treatment.
  • You must set up the Remotion repository locally and test your changes. Contributing to Remotion | Remotion | Make videos programmatically in React
  • Your PR must fulfill the acceptance criteria.
  • If you use AI, you must verify that the output is correct.
  • All tests (functionality and formatting) must pass.

Issue already taken? Find more issues under https://remotion.dev/bounties

/bounty 200

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions