🎥 Make videos programmatically with React
"Available from" badges
Jonny Burger5d6d69544205
diff --git a/packages/docs/docs/audio.md b/packages/docs/docs/audio.mdindex be90ffa54a..2d3b7f904e 100644--- a/packages/docs/docs/audio.md+++ b/packages/docs/docs/audio.md@@ -73,9 +73,7 @@ export const MyVideo = () => {};```-### `playbackRate`--_Available from v2.2_+### `playbackRate` <AvailableFrom v="2.2.0"/>You can use the `playbackRate` prop to control the speed of the audio. `1` is the default and means regular speed, `0.5` slows down the audio so it's twice as long and `2` speeds up the audio so it's twice as fast.@@ -93,9 +91,7 @@ export const MyVideo = () => {};```-### `muted`--_Available from v2.0_+### `muted` <AvailableFrom v="2.0.0"/>The `muted` prop will be respected. It will lead to no audio being played while still keeping the audio tag mounted. It's value may change over time, for example to only mute a certain section of the audio.@@ -112,9 +108,7 @@ export const MyVideo = () => {};```-### `loop`--_Available from v3.2.29_+### `loop` <AvailableFrom v="3.2.29"/>You can use the `loop` prop to loop audio.@@ -131,15 +125,11 @@ export const MyVideo = () => {};```-## `acceptableTimeShiftInSeconds`--_Available from v3.2.42_+## `acceptableTimeShiftInSeconds` <AvailableFrom v="3.2.42"/>During [Preview](/docs/terminology#remotion-preview) or in the [Remotion Player](/docs/player), Remotion will seek the audio if it gets too much out of sync with Remotion's internal time - be it due to the audio loading or the page being too slow to keep up in real-time. By default, a seek is triggered if `0.45` seconds of time shift is encountered. Using this prop, you can customize the threshold.-## `allowAmplificationDuringRender`--_Available from v3.3.17_+## `allowAmplificationDuringRender` <AvailableFrom v="3.3.17"/>Make values for [`volume`](#volume) greater than `1` result in amplification during renders.During Preview, the volume will be limited to `1`, since the browser cannot amplify audio.diff --git a/packages/docs/docs/config.md b/packages/docs/docs/config.mdindex fda3569a8b..3f810f8bbd 100644--- a/packages/docs/docs/config.md+++ b/packages/docs/docs/config.md@@ -45,9 +45,7 @@ Config.setCachingEnabled(false);The old way is deprecated, but will work for the foreseeable future.-## overrideWebpackConfig()--_Available from Version 1.1._+## overrideWebpackConfig() <AvailableFrom v="1.1.0" />Allows you to insert your custom Webpack config. [See the page about custom Webpack configs](/docs/webpack) for more information.@@ -63,9 +61,7 @@ Config.overrideWebpackConfig((currentConfiguration) => {});```-## setCachingEnabled()--_Available from Version 2.0._+## setCachingEnabled() <AvailableFrom v="2.0.0" />Enable or disable Webpack caching. Default is `true` which will make the Webpack step in the first run a bit slower but will massively speed up subsequent runs.@@ -97,9 +93,7 @@ Config.setPort(3003);The [command line flag](/docs/cli/render#--port) `--port` will take precedence over this option.-## setPublicDir()--_Available from v3.2.13_+## setPublicDir() <AvailableFrom v="3.2.13" />Define the location of the `public/` directory.By default it is a folder named "public" inside the current working directory.@@ -113,9 +107,7 @@ Config.setPublicDir("./publico");The [command line flag](/docs/cli/render#--public-dir) `--public-dir` will take precedence over this option.-## setEntryPoint()--_Available from v3.2.40_+## setEntryPoint() <AvailableFrom v="3.2.40" />Sets the Remotion [entry point](/docs/terminology#entry-point), you don't have to specify it for CLI commands.@@ -127,9 +119,7 @@ Config.setEntryPoint("./src/index.ts");If you pass an entry point as a CLI argument, it will take precedence.-## setLevel()--_Available from Version 2.0.1_+## setLevel() <AvailableFrom v="2.0.1" />Increase or decrease the amount of log messages in the CLI.Acceptable values:@@ -147,9 +137,7 @@ Config.setLevel("verbose");The [command line flag](/docs/cli/render#--log) `--log` will take precedence over this option.-## setMaxTimelineTracks()--_Available from Version 2.1.10._+## setMaxTimelineTracks() <AvailableFrom v="2.1.10" />Set how many tracks are being displayed in the timeline in the Preview at most. This does not affect your video, just the amount of tracks shown when previewing. Default `15`.@@ -159,9 +147,7 @@ import { Config } from "remotion";Config.setMaxTimelineTracks(20);```-## setKeyboardShortcutsEnabled()--_available from v3.2.11_+## setKeyboardShortcutsEnabled() <AvailableFrom v="3.2.11" />Whether the Preview should react to keyboard shortcuts. Default `true`.@@ -173,9 +159,7 @@ Config.setKeyboardShortcutsEnabled(false);The [command line flag](/docs/cli/preview#--disable-keyboard-shortcuts) `--disable-keyboard-shortcuts` will take precedence over this option.-## setWebpackPollingInMilliseconds()--_available from v3.3.11_+## setWebpackPollingInMilliseconds() <AvailableFrom v="3.3.11" />Enables Webpack polling instead of the file system event listeners for hot reloading.This is useful if you are inside a virtual machine or have a remote file system.@@ -188,9 +172,7 @@ Config.setWebpackPollingInMilliseconds(1000);The [command line flag](/docs/cli/preview#--webpack-poll) `--webpack-poll` will take precedence over this option.-## setNumberOfSharedAudioTags()--_available from v3.3.2_+## setNumberOfSharedAudioTags() <AvailableFrom v="3.3.2" />How many shared audio tags should be mounted in the Preview. Shared audio tags can help prevent playback issues due to audio autoplay policies of the browser. See [this article](/docs/player/autoplay#use-the-numberofsharedaudiotags-property) which covers the same option but for the Player. Default `0`, meaning no autoplay policies are circumvented.@@ -201,9 +183,7 @@ import { Config } from "remotion";Config.setNumberOfSharedAudioTags(5);```-## setShouldOpenBrowser()--_available from v3.3.19_+## setShouldOpenBrowser() <AvailableFrom v="3.3.19" />Whether Remotion should open a browser when starting the Preview. Default `true`.@@ -214,9 +194,7 @@ import { Config } from "remotion";Config.setShouldOpenBrowser(false);```-## setBrowserExecutable()--_Available from Version 1.5._+## setBrowserExecutable() <AvailableFrom v="1.5.0" />Set a custom Chrome or Chromium executable path. By default Remotion will try to find an existing version of Chrome on your system and if not found, it will download one. This flag is useful if you don't have Chrome installed in a standard location and you want to prevent downloading an additional browser or need [support for the H264 codec](/docs/video#codec-support).@@ -228,9 +206,7 @@ Config.setBrowserExecutable("/usr/bin/google-chrome-stable");The [command line flag](/docs/cli/render#--browser-executable) `--browser-executable` will take precedence over this option.-## setDelayRenderTimeoutInMilliseconds()--_Available from Version 2.6.3._+## setDelayRenderTimeoutInMilliseconds() <AvailableFrom v="2.6.3" />_previously named "setTimeoutInMilliseconds"_@@ -244,9 +220,7 @@ Config.setDelayRenderTimeoutInMilliseconds(60000);The [command line flag](/docs/cli/render#--timeout) `--timeout` will take precedence over this option.-## setChromiumDisableWebSecurity()--_Available from Version 2.6.5._+## setChromiumDisableWebSecurity() <AvailableFrom v="2.6.5" />This will most notably disable CORS among other security features during rendering.@@ -260,9 +234,7 @@ Config.setChromiumDisableWebSecurity(true);The [command line flag](/docs/cli/render#--disable-web-security) `--disable-web-security` will take precedence over this option.-## setChromiumIgnoreCertificateErrors()--_Available from Version 2.6.5._+## setChromiumIgnoreCertificateErrors() <AvailableFrom v="2.6.5" />Results in invalid SSL certificates, such as self-signed ones, being ignored during rendering.@@ -276,9 +248,7 @@ Config.setChromiumIgnoreCertificateErrors(true);The [command line flag](/docs/cli/render#--ignore-certificate-errors) `--ignore-certificate-errors` will take precedence over this option.-## setChromiumHeadlessMode()--_Available from Version 2.6.5._+## setChromiumHeadlessMode() <AvailableFrom v="2.6.5" />By default `true`. Disabling it will open an actual Chrome window where you can see the render happen.@@ -309,9 +279,7 @@ The [command line flag](/docs/cli/render#--concurrency) `--concurrency` will takTry to set your concurrency to `os.cpus().length` to all the threads available on your CPU for faster rendering. The drawback is that other parts of your system might slow down.:::-## setImageFormat()--_Available from Version 1.4._+## setImageFormat() <AvailableFrom v="1.4.0" />Determines which in which image format to render the frames. Either:@@ -327,9 +295,7 @@ Config.setImageFormat("png");The [command line flag](/docs/cli/render#--image-format) `--image-format` will take precedence over this option.-## setScale()--_Available from Version 2.6.7._+## setScale() <AvailableFrom v="2.6.7" />[Scales the output frames by the factor you pass in.](/docs/scaling) For example, a 1280x720px frame will become a 1920x1080px frame with a scale factor of `1.5`. Vector elements like fonts and HTML markups will be rendered with extra details. Default: `1`.@@ -341,9 +307,7 @@ Config.setScale(2);The [command line flag](/docs/cli/render#--scale) `--scale` will take precedence over this option.-## setMuted()--_Available from Version 3.2.1._+## setMuted() <AvailableFrom v="3.2.1" />Disables audio output. Default `false`.@@ -355,9 +319,7 @@ Config.setMuted(true);The [command line flag](/docs/cli/render#--muted) `--muted` will take precedence over this option.-## setEnforceAudioTrack()--_Available from Version 3.2.1._+## setEnforceAudioTrack() <AvailableFrom v="3.2.1" />Render a silent audio track if there would be none otherwise. Default `false`.@@ -369,9 +331,7 @@ Config.setEnforceAudioTrack(true);The [command line flag](/docs/cli/render#--enforce-audio-track) `--enforce-audio-track` will take precedence over this option.-## setFrameRange()--_Available from Version 2.0._+## setFrameRange() <AvailableFrom v="2.0.0" />Pass a number to render a still frame or a tuple to render a subset of a video. The frame sequence is zero-indexed.@@ -465,9 +425,7 @@ Config.setNumberOfGifLoops(2);The [command line flag](/docs/cli/render#--number-of-gif-loops) `--number-of-gif-loops` will take precedence over this option.-## setOutputLocation()--_Available from v3.1.6_+## setOutputLocation() <AvailableFrom v="3.1.6" />Set the output location of the video or still, relative to the current working directory. The default is `out/{composition}.{container}`. For example, `out/HelloWorld.mp4`.@@ -506,9 +464,7 @@ Config.setPixelFormat("yuv420p");The [command line flag](/docs/cli/render#--pixel-format) `--pixel-format` will take precedence over this option.-## setCodec()--_Available from Version 1.4._+## setCodec() <AvailableFrom v="1.4.0" />Choose one of the supported codecs: `h264` _(default)_, `h265`, `vp8`, `vp9`.@@ -550,9 +506,7 @@ The [command line flag](/docs/cli/render#--audio-codec) `--audio-codec` will takRefer to the [Encoding guide](/docs/encoding) to see defaults and supported combinations.-## setProResProfile()--_Available from Version 2.1.6._+## setProResProfile() <AvailableFrom v="2.1.6" />Set the ProRes profile. This option is only valid if the codec has been set to `prores`.Possible values: `4444-xq`, `4444`, `hq`, `standard`, `light`, `proxy`.@@ -569,9 +523,7 @@ The [command line flag](/docs/cli/render#--prores-profile) `--prores-profile` wi**See also**: [Encoding guide](/docs/encoding), [Transparent videos](/docs/transparent-videos)-## setImageSequence()--_Available from Version 1.4._+## setImageSequence() <AvailableFrom v="1.4.0" />Set to true if you want to output an image sequence instead of a video.@@ -583,9 +535,7 @@ Config.setImageSequence(true);The [command line flag](/docs/cli/render#--sequence) `--sequence` will take precedence over this option.-## overrideHeight()--_Available from v3.2.40_+## overrideHeight() <AvailableFrom v="3.2.40" />Overrides the height of the rendered video.@@ -598,9 +548,7 @@ Config.overrideHeight(600);The [command line flag](/docs/cli/render#--height) `--height` will take precedence over this option.(see h264 validation?)-## overrideWidth()--_Available from v3.2.40_+## overrideWidth() <AvailableFrom v="3.2.40" />Overrides the width of the rendered video.@@ -628,9 +576,7 @@ The [command line flags](/docs/cli) `--sequence` and `--codec` will take precedeThe [command line flag](/docs/cli) `--quality` will take precedence over this option.-## setCrf()--_Available from Version 1.4._+## setCrf() <AvailableFrom v="1.4.0" />The "Constant Rate Factor" (CRF) of the output. [Use this setting to tell FFMPEG how to trade off size and quality.](/docs/encoding#controlling-quality-using-the-crf-setting)@@ -655,9 +601,7 @@ Config.setCrf(16);The [command line flag](/docs/cli/render#--crf) `--crf` will take precedence over this option.-## overrideFfmpegCommand--_available from v3.2.22_+## overrideFfmpegCommand <AvailableFrom v="3.2.22" />Modifies the FFMPEG command that Remotion uses under the hood. It works reducer-style, meaning that you pass a function that takes a command as an argument and returns a new command.diff --git a/packages/docs/src/components/AvailableFrom.tsx b/packages/docs/src/components/AvailableFrom.tsxnew file mode 100644index 0000000000..2ef9667d16--- /dev/null+++ b/packages/docs/src/components/AvailableFrom.tsx@@ -0,0 +1,38 @@+import React from "react";++const link: React.CSSProperties = {+ textDecoration: "none",+ fontSize: 16,+};++const label: React.CSSProperties = {+ fontSize: "0.9em",+ border: "1px solid var(--ifm-color-emphasis-300)",+ color: "var(--ifm-color-emphasis-600)",+ fontFamily: "GTPlanar",+ paddingLeft: 6,+ paddingRight: 6,+ borderRadius: 3,+ paddingTop: 2,+ paddingBottom: 2,+};++export const AvailableFrom: React.FC<{+ v: string;+}> = ({ v }) => {+ if (!v) {+ throw new Error("v is required");+ }++ return (+ <a+ target={"_blank"}+ style={link}+ href={`https://github.com/remotion-dev/remotion/releases/v${v}`}+ >+ <span style={label} title={`Added in v${v}`}>+ v{v}+ </span>+ </a>+ );+};diff --git a/packages/docs/src/theme/MDXComponents.js b/packages/docs/src/theme/MDXComponents.jsindex 9351df9693..46eee19886 100644--- a/packages/docs/src/theme/MDXComponents.js+++ b/packages/docs/src/theme/MDXComponents.js@@ -3,6 +3,7 @@ import MDXComponents from "@theme-original/MDXComponents";import { Demo } from "../../components/demos";import { ExperimentalBadge } from "../../components/Experimental";import { InlineStep, Step } from "../../components/InlineStep";+import { AvailableFrom } from "../components/AvailableFrom";export default {...MDXComponents,@@ -10,4 +11,5 @@ export default {ExperimentalBadge,Step,Demo,+ AvailableFrom,};