Skip to content

🎥 Make videos programmatically with React

add docs

Jonny Burgerc8d9d7e8a2a3
diff --git a/packages/docs/docs/media-parser/parse-media.mdx b/packages/docs/docs/media-parser/parse-media.mdx
index 46fc73744c..2940cf9a3c 100644
--- a/packages/docs/docs/media-parser/parse-media.mdx
+++ b/packages/docs/docs/media-parser/parse-media.mdx
@@ -243,8 +243,10 @@ If the signal is aborted, the parser will stop reading the media and stop the de
### Callbacks
-Each field also has a callback that allows you to retrieve the value as soon as it is obtained without waiting for the function to resolve.
-You must pass `true` as the value for the field in order for the callback to be called.
+Each field also has a callback that allows you to retrieve the value as soon as it is obtained without waiting for the function to resolve.
+
+You do not have to add the field to the [`fields`](#fields) object if you use the callback.
+However, just like with [`fields`](#fields), adding a callback for a [slow field](/docs/media-parser/fast-and-slow) may require reading more of the file.
```tsx twoslash title="Using a callback"
// @module: es2022
@@ -254,10 +256,6 @@ import {parseMedia} from '@remotion/media-parser';
const result = await parseMedia({
src: 'https://example.com/my-video.mp4',
- fields: {
- durationInSeconds: true,
- dimensions: true,
- },
onDurationInSeconds: (durationInSeconds) => {
console.log(durationInSeconds);
},
diff --git a/packages/docs/docs/webcodecs/convert-media.mdx b/packages/docs/docs/webcodecs/convert-media.mdx
index 97a9a11245..340eea3b95 100644
--- a/packages/docs/docs/webcodecs/convert-media.mdx
+++ b/packages/docs/docs/webcodecs/convert-media.mdx
@@ -77,6 +77,14 @@ _number_
The number of degrees to rotate the video. See [Rotate a video](/docs/webcodecs/rotate-a-video) for more information.
+### `apiKey?`
+
+If you are a customer of a [Remotion Company License](https://remotion.pro/license), you can provide an API key from your dashboard to track your conversions.
+
+:::note
+[Telemetry is enabled](/docs/webcodecs/telemetry) even if you don't provide an API key.
+:::
+
### `logLevel?`
_string_ <TsType type="LogLevel" source="@remotion/media-parser"/>
diff --git a/packages/docs/docs/webcodecs/telemetry.mdx b/packages/docs/docs/webcodecs/telemetry.mdx
new file mode 100644
index 0000000000..619950c497
--- /dev/null
+++ b/packages/docs/docs/webcodecs/telemetry.mdx
@@ -0,0 +1,61 @@
+---
+image: /generated/articles-docs-webcodecs-telemetry.png
+id: telemetry
+title: Telemetry in @remotion/webcodecs
+slug: /webcodecs/telemetry
+crumb: '@remotion/webcodecs'
+---
+
+Upon finishing a conversion with [`convertMedia()`](/docs/webcodecs/convert-media), a HTTP request is sent to an endpoint on [`remotion.pro`](https://remotion.pro), registering the domain and whether the conversion was successful.
+
+Telemetry will never cause any conversions to fail.
+
+import {LicenseDisclaimer} from './LicenseDisclaimer';
+
+<details>
+ <summary>💼 Important License Disclaimer</summary>
+ <LicenseDisclaimer />
+</details>
+
+## Data collection
+
+No user data is collected, however the IP address may be used to reject invalid telemetry.
+
+## Use of data
+
+Telemetry data helps Remotion understand which sites use the [`@remotion/webcodecs`](/docs/webcodecs) package.
+
+Historically, it's been difficult to understand which sites use Remotion and various sizable companies have been using it without getting the appropriate license.
+
+Hence we have decided to add telemetry to this new package.
+
+Remotion will not share any telemetry data with others.
+
+## Track conversions with an API key
+
+You may add an API key that you obtained from [`remotion.pro`](https://remotion.pro) to the [`convertMedia()`](/docs/webcodecs/convert-media) function.
+
+```tsx twoslash title="Adding an API key"
+// @module: es2022
+// @target: es2017
+import {convertMedia} from '@remotion/webcodecs';
+
+await convertMedia({
+ src: 'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4',
+ container: 'webm',
+ apiKey: 'rm_pub_abcdefghijklo',
+});
+```
+
+You will then be able to see the amount of conversions you did on your dashboard.
+For now, you still need to adjust the license manually to cover your WebCodecs conversions.
+
+## Disabling telemetry
+
+A version of [`@remotion/webcodecs`](/docs/webcodecs) without telemetry can be obtained with an Remotion Enterprise License.
+Contact [email protected] to request an Enterprise License.
+
+## See also
+
+- [`@remotion/licensing`](/docs/licensing)
+- [`convertMedia()`](/docs/webcodecs/convert-media)
diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.js
index 09f515ac88..4f061d5e30 100644
--- a/packages/docs/sidebars.js
+++ b/packages/docs/sidebars.js
@@ -927,6 +927,7 @@ module.exports = {
'webcodecs/convert-a-video',
'webcodecs/rotate-a-video',
'webcodecs/fix-mediarecorder-video',
+ 'webcodecs/telemetry',
],
},
{
diff --git a/packages/docs/src/data/articles.ts b/packages/docs/src/data/articles.ts
index 3339f00ebe..6c99e513b5 100644
--- a/packages/docs/src/data/articles.ts
+++ b/packages/docs/src/data/articles.ts
@@ -3382,6 +3382,13 @@ export const articles = [
compId: 'articles-docs-webcodecs-fix-a-mediarecorder-video',
crumb: '@remotion/webcodecs',
},
+ {
+ id: 'telemetry',
+ title: 'Telemetry in @remotion/webcodecs',
+ relativePath: 'docs/webcodecs/telemetry.mdx',
+ compId: 'articles-docs-webcodecs-telemetry',
+ crumb: '@remotion/webcodecs',
+ },
{
id: 'convert-a-video',
title: 'Convert a video',
diff --git a/packages/docs/static/generated/articles-docs-webcodecs-telemetry.png b/packages/docs/static/generated/articles-docs-webcodecs-telemetry.png
new file mode 100644
index 0000000000..787a8355ec
Binary files /dev/null and b/packages/docs/static/generated/articles-docs-webcodecs-telemetry.png differ