@remotion/vercel 4.0.427 → 4.0.429

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,18 +1,18 @@
1
1
  # @remotion/vercel
2
-
2
+
3
3
  Render Remotion videos on Vercel Sandbox
4
-
4
+
5
5
  [![NPM Downloads](https://img.shields.io/npm/dm/@remotion/vercel.svg?style=flat&color=black&label=Downloads)](https://npmcharts.com/compare/@remotion/vercel?minimal=true)
6
-
6
+
7
7
  ## Installation
8
-
8
+
9
9
  ```bash
10
10
  npm install @remotion/vercel --save-exact
11
11
  ```
12
-
12
+
13
13
  When installing a Remotion package, make sure to align the version of all `remotion` and `@remotion/*` packages to the same version.
14
14
  Remove the `^` character from the version number to use the exact version.
15
-
15
+
16
16
  ## Usage
17
-
17
+
18
18
  See the [documentation](https://www.remotion.dev/docs/vercel/api) for more information.
@@ -0,0 +1,6 @@
1
+ import type { VercelSandbox } from './types';
2
+ export declare function createSnapshot({ sandbox }: {
3
+ sandbox: VercelSandbox;
4
+ }): Promise<{
5
+ snapshotId: string;
6
+ }>;
@@ -47,8 +47,8 @@ async function addBundleToSandbox({
47
47
  }
48
48
  // script-embed:render-still-script
49
49
  var script = `// src/scripts/render-still.ts
50
- import { RenderInternals } from "@remotion/renderer";
51
50
  import { statSync } from "fs";
51
+ import { RenderInternals } from "@remotion/renderer";
52
52
 
53
53
  // ../core/dist/esm/no-react.mjs
54
54
  function interpolateFunction(input, inputRange, outputRange, options) {
@@ -783,8 +783,8 @@ try {
783
783
 
784
784
  // script-embed:render-video-script
785
785
  var script2 = `// src/scripts/render-video.ts
786
- import { RenderInternals } from "@remotion/renderer";
787
786
  import { statSync } from "fs";
787
+ import { RenderInternals } from "@remotion/renderer";
788
788
 
789
789
  // ../core/dist/esm/no-react.mjs
790
790
  function interpolateFunction(input, inputRange, outputRange, options) {
@@ -1563,8 +1563,8 @@ try {
1563
1563
 
1564
1564
  // script-embed:upload-blob-script
1565
1565
  var script3 = `// src/scripts/upload-blob.ts
1566
- import { put } from "@vercel/blob";
1567
1566
  import { readFileSync, statSync } from "fs";
1567
+ import { put } from "@vercel/blob";
1568
1568
  var config = JSON.parse(process.argv[2]);
1569
1569
  try {
1570
1570
  const fileBuffer = readFileSync(config.sandboxFilePath);
@@ -0,0 +1,5 @@
1
+ import type { CreateSandboxOnProgress, VercelSandbox } from './types';
2
+ export declare function getOrCreateSandbox({ bundleDir, onProgress }: {
3
+ bundleDir: string;
4
+ onProgress?: CreateSandboxOnProgress;
5
+ }): Promise<VercelSandbox>;
@@ -0,0 +1 @@
1
+ export declare function getSnapshot(): Promise<string | null>;
@@ -0,0 +1 @@
1
+ export declare const script = "import {ensureBrowser} from '@remotion/renderer';\n\nawait ensureBrowser({\n\tonBrowserDownload: () => {\n\t\treturn {\n\t\t\tversion: null,\n\t\t\tonProgress: ({percent}) => {\n\t\t\t\tconsole.log(JSON.stringify({type: 'browser-progress', percent}));\n\t\t\t},\n\t\t};\n\t},\n});\n";
@@ -0,0 +1 @@
1
+ export declare const script = "import {RenderInternals} from '@remotion/renderer';\nimport {statSync} from 'fs';\nimport {NoReactInternals} from 'remotion/no-react';\n\ntype InternalStillOptions = Parameters<\n\ttypeof RenderInternals.internalRenderStill\n>[0];\n\ntype RenderStillConfig = {\n\tcompositionId: string;\n\tinputProps: Record<string, unknown>;\n\toutput: InternalStillOptions['output'];\n\tserveUrl: InternalStillOptions['serveUrl'];\n\tframe: InternalStillOptions['frame'];\n\timageFormat: InternalStillOptions['imageFormat'];\n\tjpegQuality: InternalStillOptions['jpegQuality'];\n\tenvVariables: InternalStillOptions['envVariables'];\n\toverwrite: InternalStillOptions['overwrite'];\n\tbrowserExecutable: InternalStillOptions['browserExecutable'];\n\tchromiumOptions: InternalStillOptions['chromiumOptions'];\n\tscale: InternalStillOptions['scale'];\n\tlogLevel: InternalStillOptions['logLevel'];\n\ttimeoutInMilliseconds: InternalStillOptions['timeoutInMilliseconds'];\n\tbinariesDirectory: InternalStillOptions['binariesDirectory'];\n\tchromeMode: InternalStillOptions['chromeMode'];\n\toffthreadVideoCacheSizeInBytes: InternalStillOptions['offthreadVideoCacheSizeInBytes'];\n\tmediaCacheSizeInBytes: InternalStillOptions['mediaCacheSizeInBytes'];\n\toffthreadVideoThreads: InternalStillOptions['offthreadVideoThreads'];\n\tlicenseKey: InternalStillOptions['licenseKey'];\n};\n\nconst config: RenderStillConfig = JSON.parse(process.argv[2]);\n\nconst noop = () => undefined;\n\ntry {\n\tconst serializedInputProps = NoReactInternals.serializeJSONWithSpecialTypes({\n\t\tdata: config.inputProps,\n\t\tindent: undefined,\n\t\tstaticBase: null,\n\t}).serializedString;\n\n\tconsole.log(JSON.stringify({type: 'opening-browser'}));\n\n\tconst browser = await RenderInternals.internalOpenBrowser({\n\t\tbrowser: 'chrome',\n\t\tbrowserExecutable: config.browserExecutable,\n\t\tchromiumOptions: config.chromiumOptions,\n\t\tforceDeviceScaleFactor: undefined,\n\t\tviewport: null,\n\t\tindent: false,\n\t\tlogLevel: config.logLevel,\n\t\tonBrowserDownload: () => ({\n\t\t\tversion: null,\n\t\t\tonProgress: noop,\n\t\t}),\n\t\tchromeMode: config.chromeMode,\n\t});\n\n\tconsole.log(JSON.stringify({type: 'selecting-composition'}));\n\n\tconst {metadata: composition} =\n\t\tawait RenderInternals.internalSelectComposition({\n\t\t\tserializedInputPropsWithCustomSchema: serializedInputProps,\n\t\t\tenvVariables: config.envVariables,\n\t\t\tpuppeteerInstance: browser,\n\t\t\tonBrowserLog: null,\n\t\t\tbrowserExecutable: config.browserExecutable,\n\t\t\tchromiumOptions: config.chromiumOptions,\n\t\t\tport: null,\n\t\t\tindent: false,\n\t\t\tserver: undefined,\n\t\t\tserveUrl: config.serveUrl,\n\t\t\tid: config.compositionId,\n\t\t\tonServeUrlVisited: noop,\n\t\t\tlogLevel: config.logLevel,\n\t\t\ttimeoutInMilliseconds: config.timeoutInMilliseconds,\n\t\t\tbinariesDirectory: config.binariesDirectory,\n\t\t\tonBrowserDownload: () => ({\n\t\t\t\tversion: null,\n\t\t\t\tonProgress: noop,\n\t\t\t}),\n\t\t\tchromeMode: config.chromeMode,\n\t\t\tmediaCacheSizeInBytes: config.mediaCacheSizeInBytes,\n\t\t\toffthreadVideoCacheSizeInBytes: config.offthreadVideoCacheSizeInBytes,\n\t\t\toffthreadVideoThreads: config.offthreadVideoThreads,\n\t\t});\n\n\tconst serializedResolvedProps =\n\t\tNoReactInternals.serializeJSONWithSpecialTypes({\n\t\t\tdata: composition.props,\n\t\t\tindent: undefined,\n\t\t\tstaticBase: null,\n\t\t}).serializedString;\n\n\tawait RenderInternals.internalRenderStill({\n\t\toutput: config.output,\n\t\tcomposition,\n\t\tserializedInputPropsWithCustomSchema: serializedInputProps,\n\t\tserializedResolvedPropsWithCustomSchema: serializedResolvedProps,\n\t\tserveUrl: config.serveUrl,\n\t\tframe: config.frame,\n\t\timageFormat: config.imageFormat,\n\t\tjpegQuality: config.jpegQuality,\n\t\tenvVariables: config.envVariables,\n\t\toverwrite: config.overwrite,\n\t\tbrowserExecutable: config.browserExecutable,\n\t\tchromiumOptions: config.chromiumOptions,\n\t\tscale: config.scale,\n\t\tlogLevel: config.logLevel,\n\t\ttimeoutInMilliseconds: config.timeoutInMilliseconds,\n\t\tbinariesDirectory: config.binariesDirectory,\n\t\tchromeMode: config.chromeMode,\n\t\toffthreadVideoCacheSizeInBytes: config.offthreadVideoCacheSizeInBytes,\n\t\tmediaCacheSizeInBytes: config.mediaCacheSizeInBytes,\n\t\toffthreadVideoThreads: config.offthreadVideoThreads,\n\t\tlicenseKey: config.licenseKey,\n\t\t// Non-serializable fields with defaults\n\t\tpuppeteerInstance: browser,\n\t\tonBrowserLog: null,\n\t\tonDownload: null,\n\t\tcancelSignal: null,\n\t\tindent: false,\n\t\tserver: undefined,\n\t\tport: null,\n\t\tonArtifact: null,\n\t\tonLog: RenderInternals.defaultOnLog,\n\t\tisProduction: true,\n\t\tonBrowserDownload: () => ({\n\t\t\tversion: null,\n\t\t\tonProgress: noop,\n\t\t}),\n\t});\n\n\tconsole.log(JSON.stringify({type: 'render-complete'}));\n\tawait browser.close({silent: false});\n\n\tconst {size} = statSync(config.output ?? '/tmp/still.png');\n\tconsole.log(JSON.stringify({type: 'done', size}));\n} catch (err) {\n\tconsole.error((err as Error).message);\n\tprocess.exit(1);\n}\n";
@@ -0,0 +1 @@
1
+ export declare const script = "import type {InternalRenderMediaOptions} from '@remotion/renderer';\nimport {RenderInternals} from '@remotion/renderer';\nimport {statSync} from 'fs';\nimport {NoReactInternals} from 'remotion/no-react';\n\ntype RenderVideoConfig = {\n\tcompositionId: string;\n\tinputProps: Record<string, unknown>;\n\toutputLocation: InternalRenderMediaOptions['outputLocation'];\n\tserveUrl: InternalRenderMediaOptions['serveUrl'];\n\tcrf: InternalRenderMediaOptions['crf'];\n\timageFormat: InternalRenderMediaOptions['imageFormat'];\n\tpixelFormat: InternalRenderMediaOptions['pixelFormat'];\n\tenvVariables: InternalRenderMediaOptions['envVariables'];\n\tframeRange: InternalRenderMediaOptions['frameRange'];\n\teveryNthFrame: InternalRenderMediaOptions['everyNthFrame'];\n\toverwrite: InternalRenderMediaOptions['overwrite'];\n\tproResProfile: NonNullable<\n\t\tInternalRenderMediaOptions['proResProfile']\n\t> | null;\n\tchromiumOptions: InternalRenderMediaOptions['chromiumOptions'];\n\tscale: InternalRenderMediaOptions['scale'];\n\tbrowserExecutable: InternalRenderMediaOptions['browserExecutable'];\n\tpreferLossless: InternalRenderMediaOptions['preferLossless'];\n\tenforceAudioTrack: InternalRenderMediaOptions['enforceAudioTrack'];\n\tdisallowParallelEncoding: InternalRenderMediaOptions['disallowParallelEncoding'];\n\tconcurrency: InternalRenderMediaOptions['concurrency'];\n\tbinariesDirectory: InternalRenderMediaOptions['binariesDirectory'];\n\tmetadata: InternalRenderMediaOptions['metadata'];\n\tlicenseKey: InternalRenderMediaOptions['licenseKey'];\n\tcodec: InternalRenderMediaOptions['codec'];\n\tvideoBitrate: InternalRenderMediaOptions['videoBitrate'];\n\taudioBitrate: InternalRenderMediaOptions['audioBitrate'];\n\tencodingMaxRate: InternalRenderMediaOptions['encodingMaxRate'];\n\tencodingBufferSize: InternalRenderMediaOptions['encodingBufferSize'];\n\tmuted: InternalRenderMediaOptions['muted'];\n\tnumberOfGifLoops: InternalRenderMediaOptions['numberOfGifLoops'];\n\tx264Preset: InternalRenderMediaOptions['x264Preset'];\n\tcolorSpace: InternalRenderMediaOptions['colorSpace'];\n\tjpegQuality: InternalRenderMediaOptions['jpegQuality'];\n\taudioCodec: InternalRenderMediaOptions['audioCodec'];\n\tlogLevel: InternalRenderMediaOptions['logLevel'];\n\ttimeoutInMilliseconds: InternalRenderMediaOptions['timeoutInMilliseconds'];\n\tforSeamlessAacConcatenation: InternalRenderMediaOptions['forSeamlessAacConcatenation'];\n\tseparateAudioTo: InternalRenderMediaOptions['separateAudioTo'];\n\thardwareAcceleration: InternalRenderMediaOptions['hardwareAcceleration'];\n\tchromeMode: InternalRenderMediaOptions['chromeMode'];\n\toffthreadVideoCacheSizeInBytes: InternalRenderMediaOptions['offthreadVideoCacheSizeInBytes'];\n\tmediaCacheSizeInBytes: InternalRenderMediaOptions['mediaCacheSizeInBytes'];\n\toffthreadVideoThreads: InternalRenderMediaOptions['offthreadVideoThreads'];\n\trepro: InternalRenderMediaOptions['repro'];\n};\n\nconst config: RenderVideoConfig = JSON.parse(process.argv[2]);\n\nconst noop = () => undefined;\n\ntry {\n\tconst serializedInputProps = NoReactInternals.serializeJSONWithSpecialTypes({\n\t\tdata: config.inputProps,\n\t\tindent: undefined,\n\t\tstaticBase: null,\n\t}).serializedString;\n\n\tconsole.log(JSON.stringify({type: 'opening-browser'}));\n\n\tconst browser = await RenderInternals.internalOpenBrowser({\n\t\tbrowser: 'chrome',\n\t\tbrowserExecutable: config.browserExecutable,\n\t\tchromiumOptions: config.chromiumOptions,\n\t\tforceDeviceScaleFactor: undefined,\n\t\tviewport: null,\n\t\tindent: false,\n\t\tlogLevel: config.logLevel,\n\t\tonBrowserDownload: () => ({\n\t\t\tversion: null,\n\t\t\tonProgress: noop,\n\t\t}),\n\t\tchromeMode: config.chromeMode,\n\t});\n\n\tconsole.log(JSON.stringify({type: 'selecting-composition'}));\n\n\tconst {metadata: composition} =\n\t\tawait RenderInternals.internalSelectComposition({\n\t\t\tserializedInputPropsWithCustomSchema: serializedInputProps,\n\t\t\tenvVariables: config.envVariables,\n\t\t\tpuppeteerInstance: browser,\n\t\t\tonBrowserLog: null,\n\t\t\tbrowserExecutable: config.browserExecutable,\n\t\t\tchromiumOptions: config.chromiumOptions,\n\t\t\tport: null,\n\t\t\tindent: false,\n\t\t\tserver: undefined,\n\t\t\tserveUrl: config.serveUrl,\n\t\t\tid: config.compositionId,\n\t\t\tonServeUrlVisited: noop,\n\t\t\tlogLevel: config.logLevel,\n\t\t\ttimeoutInMilliseconds: config.timeoutInMilliseconds,\n\t\t\tbinariesDirectory: config.binariesDirectory,\n\t\t\tonBrowserDownload: () => ({\n\t\t\t\tversion: null,\n\t\t\t\tonProgress: noop,\n\t\t\t}),\n\t\t\tchromeMode: config.chromeMode,\n\t\t\tmediaCacheSizeInBytes: config.mediaCacheSizeInBytes,\n\t\t\toffthreadVideoCacheSizeInBytes: config.offthreadVideoCacheSizeInBytes,\n\t\t\toffthreadVideoThreads: config.offthreadVideoThreads,\n\t\t});\n\n\tconst serializedResolvedProps =\n\t\tNoReactInternals.serializeJSONWithSpecialTypes({\n\t\t\tdata: composition.props,\n\t\t\tindent: undefined,\n\t\t\tstaticBase: null,\n\t\t}).serializedString;\n\n\tawait RenderInternals.internalRenderMedia({\n\t\toutputLocation: config.outputLocation,\n\t\tcomposition,\n\t\tserializedInputPropsWithCustomSchema: serializedInputProps,\n\t\tserializedResolvedPropsWithCustomSchema: serializedResolvedProps,\n\t\tserveUrl: config.serveUrl,\n\t\tcodec: config.codec,\n\t\tcrf: config.crf,\n\t\timageFormat: config.imageFormat,\n\t\tpixelFormat: config.pixelFormat,\n\t\tenvVariables: config.envVariables,\n\t\tframeRange: config.frameRange,\n\t\teveryNthFrame: config.everyNthFrame,\n\t\toverwrite: config.overwrite,\n\t\tproResProfile: config.proResProfile ?? undefined,\n\t\tchromiumOptions: config.chromiumOptions,\n\t\tscale: config.scale,\n\t\tbrowserExecutable: config.browserExecutable,\n\t\tpreferLossless: config.preferLossless,\n\t\tenforceAudioTrack: config.enforceAudioTrack,\n\t\tdisallowParallelEncoding: config.disallowParallelEncoding,\n\t\tconcurrency: config.concurrency,\n\t\tbinariesDirectory: config.binariesDirectory,\n\t\tmetadata: config.metadata,\n\t\tlicenseKey: config.licenseKey,\n\t\tvideoBitrate: config.videoBitrate,\n\t\taudioBitrate: config.audioBitrate,\n\t\tencodingMaxRate: config.encodingMaxRate,\n\t\tencodingBufferSize: config.encodingBufferSize,\n\t\tmuted: config.muted,\n\t\tnumberOfGifLoops: config.numberOfGifLoops,\n\t\tx264Preset: config.x264Preset,\n\t\tcolorSpace: config.colorSpace,\n\t\tjpegQuality: config.jpegQuality,\n\t\taudioCodec: config.audioCodec,\n\t\tlogLevel: config.logLevel,\n\t\ttimeoutInMilliseconds: config.timeoutInMilliseconds,\n\t\tforSeamlessAacConcatenation: config.forSeamlessAacConcatenation,\n\t\tseparateAudioTo: config.separateAudioTo,\n\t\thardwareAcceleration: config.hardwareAcceleration,\n\t\tchromeMode: config.chromeMode,\n\t\toffthreadVideoCacheSizeInBytes: config.offthreadVideoCacheSizeInBytes,\n\t\tmediaCacheSizeInBytes: config.mediaCacheSizeInBytes,\n\t\toffthreadVideoThreads: config.offthreadVideoThreads,\n\t\trepro: config.repro,\n\t\t// Non-serializable fields with defaults\n\t\tpuppeteerInstance: browser,\n\t\tonProgress: (progress) => {\n\t\t\tconsole.log(\n\t\t\t\tJSON.stringify({\n\t\t\t\t\ttype: 'progress',\n\t\t\t\t\trenderedFrames: progress.renderedFrames,\n\t\t\t\t\tencodedFrames: progress.encodedFrames,\n\t\t\t\t\tencodedDoneIn: progress.encodedDoneIn,\n\t\t\t\t\trenderedDoneIn: progress.renderedDoneIn,\n\t\t\t\t\trenderEstimatedTime: progress.renderEstimatedTime,\n\t\t\t\t\tprogress: progress.progress,\n\t\t\t\t\tstitchStage: progress.stitchStage,\n\t\t\t\t}),\n\t\t\t);\n\t\t},\n\t\tonDownload: () => undefined,\n\t\tonBrowserLog: null,\n\t\tonStart: noop,\n\t\tport: null,\n\t\tcancelSignal: undefined,\n\t\tonCtrlCExit: noop,\n\t\tindent: false,\n\t\tserver: undefined,\n\t\tffmpegOverride: undefined,\n\t\tcompositionStart: 0,\n\t\tonArtifact: null,\n\t\tonLog: RenderInternals.defaultOnLog,\n\t\tisProduction: true,\n\t\tonBrowserDownload: () => ({\n\t\t\tversion: null,\n\t\t\tonProgress: noop,\n\t\t}),\n\t});\n\n\tconsole.log(JSON.stringify({type: 'render-complete'}));\n\tawait browser.close({silent: false});\n\n\tconst {size} = statSync(config.outputLocation ?? '/tmp/video.mp4');\n\tconsole.log(JSON.stringify({type: 'done', size}));\n} catch (err) {\n\tconsole.error((err as Error).message);\n\tprocess.exit(1);\n}\n";
@@ -0,0 +1,12 @@
1
+ import type { RenderOnVercelProgress, VercelSandbox } from './types';
2
+ export declare function renderStillOnVercel({ sandbox, compositionId, inputProps, imageFormat, outputFile, onProgress, bundleDir }: {
3
+ sandbox: VercelSandbox;
4
+ compositionId: string;
5
+ inputProps: Record<string, unknown>;
6
+ imageFormat?: 'png' | 'jpeg' | 'webp';
7
+ outputFile?: string;
8
+ onProgress?: (progress: RenderOnVercelProgress) => void;
9
+ bundleDir?: string;
10
+ }): Promise<{
11
+ file: string;
12
+ }>;
@@ -0,0 +1,12 @@
1
+ import type { RenderOnVercelProgress, VercelSandbox } from './types';
2
+ export declare function renderVideoOnVercel({ sandbox, compositionId, inputProps, codec, outputFile, onProgress, bundleDir }: {
3
+ sandbox: VercelSandbox;
4
+ compositionId: string;
5
+ inputProps: Record<string, unknown>;
6
+ codec?: string;
7
+ outputFile?: string;
8
+ onProgress?: (progress: RenderOnVercelProgress) => void;
9
+ bundleDir?: string;
10
+ }): Promise<{
11
+ file: string;
12
+ }>;
@@ -0,0 +1,11 @@
1
+ import type { VercelSandbox } from './types';
2
+ export declare function uploadToBlobStorage({ sandbox, sandboxFilePath, blobPath, contentType, blobToken }: {
3
+ sandbox: VercelSandbox;
4
+ sandboxFilePath: string;
5
+ blobPath?: string;
6
+ contentType: string;
7
+ blobToken: string;
8
+ }): Promise<{
9
+ url: string;
10
+ size: number;
11
+ }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/vercel",
3
- "version": "4.0.427",
3
+ "version": "4.0.429",
4
4
  "description": "Render Remotion videos on Vercel Sandbox",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -11,7 +11,7 @@
11
11
  "sideEffects": false,
12
12
  "type": "module",
13
13
  "scripts": {
14
- "formatting": "prettier src --check",
14
+ "formatting": "oxfmt src --check",
15
15
  "lint": "eslint src",
16
16
  "watch": "tsgo -w",
17
17
  "make": "bun --env-file=../.env.bundle bundle.ts && tsgo"
@@ -23,8 +23,8 @@
23
23
  "url": "https://github.com/remotion-dev/remotion/issues"
24
24
  },
25
25
  "dependencies": {
26
- "@remotion/renderer": "4.0.427",
27
- "remotion": "4.0.427"
26
+ "@remotion/renderer": "4.0.429",
27
+ "remotion": "4.0.429"
28
28
  },
29
29
  "peerDependencies": {
30
30
  "@vercel/sandbox": ">=1.0.0"
@@ -38,7 +38,7 @@
38
38
  "./package.json": "./package.json"
39
39
  },
40
40
  "devDependencies": {
41
- "@remotion/eslint-config-internal": "4.0.427",
41
+ "@remotion/eslint-config-internal": "4.0.429",
42
42
  "@vercel/blob": "2.3.0",
43
43
  "@vercel/sandbox": "1.6.0",
44
44
  "eslint": "9.19.0",
@@ -1 +0,0 @@
1
- export {};