@remotion/renderer 4.0.481 → 4.0.483

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/dist/client.d.ts CHANGED
@@ -820,7 +820,10 @@ export declare const BrowserSafeApis: {
820
820
  type: "yuv420p" | "yuv420p10le" | "yuv422p" | "yuv422p10le" | "yuv444p" | "yuv444p10le" | "yuva420p" | "yuva444p10le";
821
821
  getValue: ({ commandLine }: {
822
822
  commandLine: Record<string, unknown>;
823
- }) => {
823
+ }, options?: {
824
+ uiPixelFormat: "yuv420p" | "yuv420p10le" | "yuv422p" | "yuv422p10le" | "yuv444p" | "yuv444p10le" | "yuva420p" | "yuva444p10le" | null;
825
+ compositionDefaultPixelFormat: "yuv420p" | "yuv420p10le" | "yuv422p" | "yuv422p10le" | "yuv444p" | "yuv444p10le" | "yuva420p" | "yuva444p10le" | null;
826
+ } | undefined) => {
824
827
  source: string;
825
828
  value: "yuv420p" | "yuv420p10le" | "yuv422p" | "yuv422p10le" | "yuv444p" | "yuv444p10le" | "yuva420p" | "yuva444p10le";
826
829
  };
@@ -874,7 +877,10 @@ export declare const BrowserSafeApis: {
874
877
  type: import("./client").ProResProfile | undefined;
875
878
  getValue: ({ commandLine }: {
876
879
  commandLine: Record<string, unknown>;
877
- }) => {
880
+ }, options?: {
881
+ uiProResProfile: import("./client").ProResProfile | undefined;
882
+ compositionDefaultProResProfile: import("./client").ProResProfile | null;
883
+ } | undefined) => {
878
884
  source: string;
879
885
  value: import("./client").ProResProfile;
880
886
  } | {
@@ -1477,7 +1483,11 @@ export declare const BrowserSafeApis: {
1477
1483
  type: "jpeg" | "none" | "png" | null;
1478
1484
  getValue: ({ commandLine }: {
1479
1485
  commandLine: Record<string, unknown>;
1480
- }) => {
1486
+ }, options?: {
1487
+ codec: import("./codec").CodecOrUndefined;
1488
+ uiVideoImageFormat: "jpeg" | "none" | "png" | null;
1489
+ compositionDefaultVideoImageFormat: "jpeg" | "none" | "png" | null;
1490
+ } | undefined) => {
1481
1491
  source: string;
1482
1492
  value: "jpeg" | "none" | "png";
1483
1493
  } | {
@@ -51,6 +51,11 @@ var validCodecs = [
51
51
  ];
52
52
  var DEFAULT_CODEC = "h264";
53
53
 
54
+ // src/is-audio-codec.ts
55
+ var isAudioCodec = (codec) => {
56
+ return codec === "mp3" || codec === "aac" || codec === "wav";
57
+ };
58
+
54
59
  // src/crf.ts
55
60
  var defaultCrfMap = {
56
61
  h264: 18,
@@ -3652,16 +3657,28 @@ var pixelFormatOption = {
3652
3657
  ssrName: "pixelFormat",
3653
3658
  docLink: "https://www.remotion.dev/docs/config#setpixelformat",
3654
3659
  type: DEFAULT_PIXEL_FORMAT,
3655
- getValue: ({ commandLine }) => {
3660
+ getValue: ({ commandLine }, options) => {
3661
+ if (options?.uiPixelFormat) {
3662
+ return {
3663
+ source: "via UI",
3664
+ value: options.uiPixelFormat
3665
+ };
3666
+ }
3656
3667
  if (commandLine[cliFlag65] !== undefined) {
3657
3668
  return {
3658
- source: "cli",
3669
+ source: "from --pixel-format flag",
3659
3670
  value: commandLine[cliFlag65]
3660
3671
  };
3661
3672
  }
3673
+ if (options && options.compositionDefaultPixelFormat !== null) {
3674
+ return {
3675
+ source: "via calculateMetadata",
3676
+ value: options.compositionDefaultPixelFormat
3677
+ };
3678
+ }
3662
3679
  if (currentPixelFormat !== DEFAULT_PIXEL_FORMAT) {
3663
3680
  return {
3664
- source: "config",
3681
+ source: "Config file",
3665
3682
  value: currentPixelFormat
3666
3683
  };
3667
3684
  }
@@ -3876,16 +3893,28 @@ var proResProfileOption = {
3876
3893
  ssrName: "proResProfile",
3877
3894
  docLink: "https://www.remotion.dev/docs/config#setproresprofile",
3878
3895
  type: undefined,
3879
- getValue: ({ commandLine }) => {
3896
+ getValue: ({ commandLine }, options) => {
3897
+ if (options?.uiProResProfile) {
3898
+ return {
3899
+ source: "via UI",
3900
+ value: options.uiProResProfile
3901
+ };
3902
+ }
3880
3903
  if (commandLine[cliFlag70] !== undefined) {
3881
3904
  return {
3882
- source: "cli",
3905
+ source: "from --prores-profile flag",
3883
3906
  value: String(commandLine[cliFlag70])
3884
3907
  };
3885
3908
  }
3909
+ if (options && options.compositionDefaultProResProfile !== null) {
3910
+ return {
3911
+ source: "via calculateMetadata",
3912
+ value: options.compositionDefaultProResProfile
3913
+ };
3914
+ }
3886
3915
  if (proResProfile !== undefined) {
3887
3916
  return {
3888
- source: "config",
3917
+ source: "Config file",
3889
3918
  value: proResProfile
3890
3919
  };
3891
3920
  }
@@ -4885,23 +4914,56 @@ var videoImageFormatOption = {
4885
4914
  ssrName: "imageFormat",
4886
4915
  docLink: "https://www.remotion.dev/docs/renderer/render-media#imageformat",
4887
4916
  type: null,
4888
- getValue: ({ commandLine }) => {
4917
+ getValue: ({ commandLine }, options) => {
4918
+ if (options?.uiVideoImageFormat) {
4919
+ return {
4920
+ source: "via UI",
4921
+ value: options.uiVideoImageFormat
4922
+ };
4923
+ }
4889
4924
  if (commandLine[cliFlag88] !== undefined) {
4890
4925
  const value3 = commandLine[cliFlag88];
4891
4926
  if (!validVideoImageFormats.includes(value3)) {
4892
4927
  throw new Error(`Invalid video image format: ${value3}. Must be one of: ${validVideoImageFormats.join(", ")}`);
4893
4928
  }
4894
4929
  return {
4895
- source: "cli",
4930
+ source: "from --image-format flag",
4896
4931
  value: value3
4897
4932
  };
4898
4933
  }
4934
+ if (options && options.compositionDefaultVideoImageFormat !== null) {
4935
+ return {
4936
+ source: "via calculateMetadata",
4937
+ value: options.compositionDefaultVideoImageFormat
4938
+ };
4939
+ }
4899
4940
  if (currentVideoImageFormat !== null) {
4900
4941
  return {
4901
- source: "config",
4942
+ source: "Config file",
4902
4943
  value: currentVideoImageFormat
4903
4944
  };
4904
4945
  }
4946
+ if (options) {
4947
+ if (isAudioCodec(options.codec)) {
4948
+ return {
4949
+ source: "default",
4950
+ value: "none"
4951
+ };
4952
+ }
4953
+ if (options.codec === "h264" || options.codec === "h264-mkv" || options.codec === "h264-ts" || options.codec === "h265" || options.codec === "av1" || options.codec === "vp8" || options.codec === "vp9" || options.codec === "prores" || options.codec === "gif") {
4954
+ return {
4955
+ source: "default",
4956
+ value: "jpeg"
4957
+ };
4958
+ }
4959
+ if (options.codec === undefined) {
4960
+ return {
4961
+ source: "default",
4962
+ value: "png"
4963
+ };
4964
+ }
4965
+ throw new Error("Unrecognized codec " + options.codec);
4966
+ }
4905
4967
  return {
4906
4968
  source: "default",
4907
4969
  value: null
@@ -574,7 +574,10 @@ export declare const allOptions: {
574
574
  type: "yuv420p" | "yuv420p10le" | "yuv422p" | "yuv422p10le" | "yuv444p" | "yuv444p10le" | "yuva420p" | "yuva444p10le";
575
575
  getValue: ({ commandLine }: {
576
576
  commandLine: Record<string, unknown>;
577
- }) => {
577
+ }, options?: {
578
+ uiPixelFormat: "yuv420p" | "yuv420p10le" | "yuv422p" | "yuv422p10le" | "yuv444p" | "yuv444p10le" | "yuva420p" | "yuva444p10le" | null;
579
+ compositionDefaultPixelFormat: "yuv420p" | "yuv420p10le" | "yuv422p" | "yuv422p10le" | "yuv444p" | "yuv444p10le" | "yuva420p" | "yuva444p10le" | null;
580
+ } | undefined) => {
578
581
  source: string;
579
582
  value: "yuv420p" | "yuv420p10le" | "yuv422p" | "yuv422p10le" | "yuv444p" | "yuv444p10le" | "yuva420p" | "yuva444p10le";
580
583
  };
@@ -628,7 +631,10 @@ export declare const allOptions: {
628
631
  type: import("./prores-profile").ProResProfile | undefined;
629
632
  getValue: ({ commandLine }: {
630
633
  commandLine: Record<string, unknown>;
631
- }) => {
634
+ }, options?: {
635
+ uiProResProfile: import("./prores-profile").ProResProfile | undefined;
636
+ compositionDefaultProResProfile: import("./prores-profile").ProResProfile | null;
637
+ } | undefined) => {
632
638
  source: string;
633
639
  value: import("./prores-profile").ProResProfile;
634
640
  } | {
@@ -1231,7 +1237,11 @@ export declare const allOptions: {
1231
1237
  type: "jpeg" | "none" | "png" | null;
1232
1238
  getValue: ({ commandLine }: {
1233
1239
  commandLine: Record<string, unknown>;
1234
- }) => {
1240
+ }, options?: {
1241
+ codec: import("..").CodecOrUndefined;
1242
+ uiVideoImageFormat: "jpeg" | "none" | "png" | null;
1243
+ compositionDefaultVideoImageFormat: "jpeg" | "none" | "png" | null;
1244
+ } | undefined) => {
1235
1245
  source: string;
1236
1246
  value: "jpeg" | "none" | "png";
1237
1247
  } | {
@@ -7,7 +7,10 @@ export declare const pixelFormatOption: {
7
7
  type: "yuv420p" | "yuv420p10le" | "yuv422p" | "yuv422p10le" | "yuv444p" | "yuv444p10le" | "yuva420p" | "yuva444p10le";
8
8
  getValue: ({ commandLine }: {
9
9
  commandLine: Record<string, unknown>;
10
- }) => {
10
+ }, options?: {
11
+ uiPixelFormat: "yuv420p" | "yuv420p10le" | "yuv422p" | "yuv422p10le" | "yuv444p" | "yuv444p10le" | "yuva420p" | "yuva444p10le" | null;
12
+ compositionDefaultPixelFormat: "yuv420p" | "yuv420p10le" | "yuv422p" | "yuv422p10le" | "yuv444p" | "yuv444p10le" | "yuva420p" | "yuva444p10le" | null;
13
+ } | undefined) => {
11
14
  source: string;
12
15
  value: "yuv420p" | "yuv420p10le" | "yuv422p" | "yuv422p10le" | "yuv444p" | "yuv444p10le" | "yuva420p" | "yuva444p10le";
13
16
  };
@@ -13,16 +13,28 @@ exports.pixelFormatOption = {
13
13
  ssrName: 'pixelFormat',
14
14
  docLink: 'https://www.remotion.dev/docs/config#setpixelformat',
15
15
  type: pixel_format_1.DEFAULT_PIXEL_FORMAT,
16
- getValue: ({ commandLine }) => {
16
+ getValue: ({ commandLine }, options) => {
17
+ if (options === null || options === void 0 ? void 0 : options.uiPixelFormat) {
18
+ return {
19
+ source: 'via UI',
20
+ value: options.uiPixelFormat,
21
+ };
22
+ }
17
23
  if (commandLine[cliFlag] !== undefined) {
18
24
  return {
19
- source: 'cli',
25
+ source: 'from --pixel-format flag',
20
26
  value: commandLine[cliFlag],
21
27
  };
22
28
  }
29
+ if (options && options.compositionDefaultPixelFormat !== null) {
30
+ return {
31
+ source: 'via calculateMetadata',
32
+ value: options.compositionDefaultPixelFormat,
33
+ };
34
+ }
23
35
  if (currentPixelFormat !== pixel_format_1.DEFAULT_PIXEL_FORMAT) {
24
36
  return {
25
- source: 'config',
37
+ source: 'Config file',
26
38
  value: currentPixelFormat,
27
39
  };
28
40
  }
@@ -8,7 +8,10 @@ export declare const proResProfileOption: {
8
8
  type: ProResProfile | undefined;
9
9
  getValue: ({ commandLine }: {
10
10
  commandLine: Record<string, unknown>;
11
- }) => {
11
+ }, options?: {
12
+ uiProResProfile: ProResProfile | undefined;
13
+ compositionDefaultProResProfile: ProResProfile | null;
14
+ } | undefined) => {
12
15
  source: string;
13
16
  value: ProResProfile;
14
17
  } | {
@@ -23,16 +23,28 @@ exports.proResProfileOption = {
23
23
  ssrName: 'proResProfile',
24
24
  docLink: 'https://www.remotion.dev/docs/config#setproresprofile',
25
25
  type: undefined,
26
- getValue: ({ commandLine }) => {
26
+ getValue: ({ commandLine }, options) => {
27
+ if (options === null || options === void 0 ? void 0 : options.uiProResProfile) {
28
+ return {
29
+ source: 'via UI',
30
+ value: options.uiProResProfile,
31
+ };
32
+ }
27
33
  if (commandLine[cliFlag] !== undefined) {
28
34
  return {
29
- source: 'cli',
35
+ source: 'from --prores-profile flag',
30
36
  value: String(commandLine[cliFlag]),
31
37
  };
32
38
  }
39
+ if (options && options.compositionDefaultProResProfile !== null) {
40
+ return {
41
+ source: 'via calculateMetadata',
42
+ value: options.compositionDefaultProResProfile,
43
+ };
44
+ }
33
45
  if (proResProfile !== undefined) {
34
46
  return {
35
- source: 'config',
47
+ source: 'Config file',
36
48
  value: proResProfile,
37
49
  };
38
50
  }
@@ -1,3 +1,4 @@
1
+ import type { CodecOrUndefined } from '../codec';
1
2
  export declare const videoImageFormatOption: {
2
3
  name: string;
3
4
  cliFlag: "image-format";
@@ -7,7 +8,11 @@ export declare const videoImageFormatOption: {
7
8
  type: "jpeg" | "none" | "png" | null;
8
9
  getValue: ({ commandLine }: {
9
10
  commandLine: Record<string, unknown>;
10
- }) => {
11
+ }, options?: {
12
+ codec: CodecOrUndefined;
13
+ uiVideoImageFormat: "jpeg" | "none" | "png" | null;
14
+ compositionDefaultVideoImageFormat: "jpeg" | "none" | "png" | null;
15
+ } | undefined) => {
11
16
  source: string;
12
17
  value: "jpeg" | "none" | "png";
13
18
  } | {
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.videoImageFormatOption = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const image_format_1 = require("../image-format");
6
+ const is_audio_codec_1 = require("../is-audio-codec");
6
7
  let currentVideoImageFormat = null;
7
8
  const cliFlag = 'image-format';
8
9
  exports.videoImageFormatOption = {
@@ -13,23 +14,64 @@ exports.videoImageFormatOption = {
13
14
  ssrName: 'imageFormat',
14
15
  docLink: 'https://www.remotion.dev/docs/renderer/render-media#imageformat',
15
16
  type: null,
16
- getValue: ({ commandLine }) => {
17
+ getValue: ({ commandLine }, options) => {
18
+ if (options === null || options === void 0 ? void 0 : options.uiVideoImageFormat) {
19
+ return {
20
+ source: 'via UI',
21
+ value: options.uiVideoImageFormat,
22
+ };
23
+ }
17
24
  if (commandLine[cliFlag] !== undefined) {
18
25
  const value = commandLine[cliFlag];
19
26
  if (!image_format_1.validVideoImageFormats.includes(value)) {
20
27
  throw new Error(`Invalid video image format: ${value}. Must be one of: ${image_format_1.validVideoImageFormats.join(', ')}`);
21
28
  }
22
29
  return {
23
- source: 'cli',
30
+ source: 'from --image-format flag',
24
31
  value,
25
32
  };
26
33
  }
34
+ if (options && options.compositionDefaultVideoImageFormat !== null) {
35
+ return {
36
+ source: 'via calculateMetadata',
37
+ value: options.compositionDefaultVideoImageFormat,
38
+ };
39
+ }
27
40
  if (currentVideoImageFormat !== null) {
28
41
  return {
29
- source: 'config',
42
+ source: 'Config file',
30
43
  value: currentVideoImageFormat,
31
44
  };
32
45
  }
46
+ if (options) {
47
+ if ((0, is_audio_codec_1.isAudioCodec)(options.codec)) {
48
+ return {
49
+ source: 'default',
50
+ value: 'none',
51
+ };
52
+ }
53
+ if (options.codec === 'h264' ||
54
+ options.codec === 'h264-mkv' ||
55
+ options.codec === 'h264-ts' ||
56
+ options.codec === 'h265' ||
57
+ options.codec === 'av1' ||
58
+ options.codec === 'vp8' ||
59
+ options.codec === 'vp9' ||
60
+ options.codec === 'prores' ||
61
+ options.codec === 'gif') {
62
+ return {
63
+ source: 'default',
64
+ value: 'jpeg',
65
+ };
66
+ }
67
+ if (options.codec === undefined) {
68
+ return {
69
+ source: 'default',
70
+ value: 'png',
71
+ };
72
+ }
73
+ throw new Error('Unrecognized codec ' + options.codec);
74
+ }
33
75
  return {
34
76
  source: 'default',
35
77
  value: null,
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/renderer"
4
4
  },
5
5
  "name": "@remotion/renderer",
6
- "version": "4.0.481",
6
+ "version": "4.0.483",
7
7
  "description": "Render Remotion videos using Node.js or Bun",
8
8
  "main": "dist/index.js",
9
9
  "types": "dist/index.d.ts",
@@ -22,11 +22,11 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "execa": "5.1.1",
25
- "remotion": "4.0.481",
26
- "@remotion/streaming": "4.0.481",
25
+ "remotion": "4.0.483",
26
+ "@remotion/streaming": "4.0.483",
27
27
  "source-map": "0.8.0-beta.0",
28
28
  "ws": "8.21.0",
29
- "@remotion/licensing": "4.0.481"
29
+ "@remotion/licensing": "4.0.483"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "react": ">=16.8.0",
@@ -40,19 +40,19 @@
40
40
  "react-dom": "19.2.3",
41
41
  "@typescript/native-preview": "7.0.0-dev.20260217.1",
42
42
  "@types/ws": "8.5.10",
43
- "@remotion/example-videos": "4.0.481",
44
- "@remotion/eslint-config-internal": "4.0.481",
43
+ "@remotion/example-videos": "4.0.483",
44
+ "@remotion/eslint-config-internal": "4.0.483",
45
45
  "eslint": "9.19.0",
46
46
  "@types/node": "20.12.14"
47
47
  },
48
48
  "optionalDependencies": {
49
- "@remotion/compositor-darwin-arm64": "4.0.481",
50
- "@remotion/compositor-darwin-x64": "4.0.481",
51
- "@remotion/compositor-linux-arm64-gnu": "4.0.481",
52
- "@remotion/compositor-linux-arm64-musl": "4.0.481",
53
- "@remotion/compositor-linux-x64-gnu": "4.0.481",
54
- "@remotion/compositor-linux-x64-musl": "4.0.481",
55
- "@remotion/compositor-win32-x64-msvc": "4.0.481"
49
+ "@remotion/compositor-darwin-arm64": "4.0.483",
50
+ "@remotion/compositor-darwin-x64": "4.0.483",
51
+ "@remotion/compositor-linux-arm64-gnu": "4.0.483",
52
+ "@remotion/compositor-linux-arm64-musl": "4.0.483",
53
+ "@remotion/compositor-linux-x64-gnu": "4.0.483",
54
+ "@remotion/compositor-linux-x64-musl": "4.0.483",
55
+ "@remotion/compositor-win32-x64-msvc": "4.0.483"
56
56
  },
57
57
  "keywords": [
58
58
  "remotion",