Skip to content

🎥 Make videos programmatically with React

Docs: `getVideoMetadata()` may return `Infinity` for duration

Jonny Burger184bd5c4586a
diff --git a/packages/docs/docs/get-video-metadata.md b/packages/docs/docs/get-video-metadata.md
index c8b5144f3f..867c209f74 100644
--- a/packages/docs/docs/get-video-metadata.md
+++ b/packages/docs/docs/get-video-metadata.md
@@ -29,6 +29,12 @@ A string pointing to an asset.
- `aspectRatio`: `number` Video width divided by video height.
- `isRemote`: `boolean` Whether the video was imported locally or from a different origin.
+:::warn
+`durationInSeconds` may return `Infinity`. This happens if the duration of the video is not stored in the beginning of the file.
+This is for example the case for videos that are recorded with a webcam and being encoded while the recording is still in progress.
+Ensure handling for `Infinity` for user-provided videos and re-encode videos with FFmpeg to move the duration to the beginning of the file.
+:::
+
## Example
```tsx twoslash