Skip to content

🎥 Make videos programmatically with React

docs: Document from and durationInFrames on @remotion/media Video and Audio

JonnyBurger2de58ccd6383
diff --git a/packages/docs/docs/media/audio.mdx b/packages/docs/docs/media/audio.mdx
index c8c92d2870..37834d656f 100644
--- a/packages/docs/docs/media/audio.mdx
+++ b/packages/docs/docs/media/audio.mdx
@@ -47,6 +47,31 @@ export const MyComposition = () => {
The URL of the audio to be rendered. Can be a remote URL or a local file referenced with [`staticFile()`](/docs/staticfile).
+### `from?`<AvailableFrom v="4.0.445" />
+
+At which frame this clip should start relative to the parent timeline. Default is `0`. Same meaning as [`from`](/docs/sequence#from) on [`<Sequence>`](/docs/sequence).
+
+### `durationInFrames?`<AvailableFrom v="4.0.445" />
+
+For how many frames the clip stays mounted. Default is `Infinity`. Same meaning as [`durationInFrames`](/docs/sequence#durationinframes) on [`<Sequence>`](/docs/sequence).
+
+:::note
+You can still wrap `<Audio>` in an outer [`<Sequence>`](/docs/sequence). Timing [cascades](/docs/sequence#cascading) like nested sequences.
+:::
+
+```tsx twoslash title="Clip starting at frame 30, lasting 90 frames"
+import {AbsoluteFill, staticFile} from 'remotion';
+import {Audio} from '@remotion/media';
+
+export const MyComposition = () => {
+ return (
+ <AbsoluteFill>
+ <Audio from={30} durationInFrames={90} src={staticFile('audio.mp3')} />
+ </AbsoluteFill>
+ );
+};
+```
+
### `trimBefore?`
Will remove a portion of the audio at the beginning (left side).
diff --git a/packages/docs/docs/media/video.mdx b/packages/docs/docs/media/video.mdx
index 49fa2e9f2c..94899d8a21 100644
--- a/packages/docs/docs/media/video.mdx
+++ b/packages/docs/docs/media/video.mdx
@@ -49,6 +49,31 @@ export const MyComposition = () => {
The URL of the video to be rendered. Can be a remote URL or a local file referenced with [`staticFile()`](/docs/staticfile).
+### `from?`<AvailableFrom v="4.0.445" />
+
+At which frame this clip should start relative to the parent timeline. Default is `0`. Same meaning as [`from`](/docs/sequence#from) on [`<Sequence>`](/docs/sequence).
+
+### `durationInFrames?`<AvailableFrom v="4.0.445" />
+
+For how many frames the clip stays mounted. Default is `Infinity`. Same meaning as [`durationInFrames`](/docs/sequence#durationinframes) on [`<Sequence>`](/docs/sequence).
+
+:::note
+You can still wrap `<Video>` in an outer [`<Sequence>`](/docs/sequence). Timing [cascades](/docs/sequence#cascading) like nested sequences.
+:::
+
+```tsx twoslash title="Clip starting at frame 30, lasting 90 frames"
+import {AbsoluteFill, staticFile} from 'remotion';
+import {Video} from '@remotion/media';
+
+export const MyComposition = () => {
+ return (
+ <AbsoluteFill>
+ <Video from={30} durationInFrames={90} src={staticFile('video.webm')} />
+ </AbsoluteFill>
+ );
+};
+```
+
### `trimBefore?`
Will remove a portion of the video at the beginning (left side).