remotion 4.0.315 → 4.0.317
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/cjs/Composition.d.ts +3 -0
- package/dist/cjs/CompositionManagerContext.d.ts +1 -1
- package/dist/cjs/ResolveCompositionConfig.js +2 -0
- package/dist/cjs/index.d.ts +4 -0
- package/dist/cjs/render-types.d.ts +4 -0
- package/dist/cjs/render-types.js +16 -0
- package/dist/cjs/resolve-video-config.js +20 -3
- package/dist/cjs/use-unsafe-video-config.js +3 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/video-config.d.ts +3 -0
- package/dist/esm/index.mjs +34 -9
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
- package/dist/esm/index2.mjs +0 -7825
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import type { AnyZodObject } from 'zod';
|
|
4
4
|
import type { Codec } from './codec.js';
|
|
5
5
|
import type { InferProps, PropsIfHasProps } from './props-if-has-props.js';
|
|
6
|
+
import type { PixelFormat, VideoImageFormat } from './render-types.js';
|
|
6
7
|
type LooseComponentType<T> = ComponentType<T> | ((props: T) => React.ReactNode);
|
|
7
8
|
export type CompProps<Props> = {
|
|
8
9
|
lazyComponent: () => Promise<{
|
|
@@ -19,6 +20,8 @@ export type CalcMetadataReturnType<T extends Record<string, unknown>> = {
|
|
|
19
20
|
props?: T;
|
|
20
21
|
defaultCodec?: Codec;
|
|
21
22
|
defaultOutName?: string;
|
|
23
|
+
defaultVideoImageFormat?: VideoImageFormat;
|
|
24
|
+
defaultPixelFormat?: PixelFormat;
|
|
22
25
|
};
|
|
23
26
|
export type CalculateMetadataFunction<T extends Record<string, unknown>> = (options: {
|
|
24
27
|
defaultProps: T;
|
|
@@ -3,7 +3,7 @@ import type { AnyZodObject } from 'zod';
|
|
|
3
3
|
import type { AnyComposition, TComposition } from './CompositionManager.js';
|
|
4
4
|
import type { TFolder } from './Folder.js';
|
|
5
5
|
import type { VideoConfig } from './video-config.js';
|
|
6
|
-
export type BaseMetadata = Pick<VideoConfig, 'durationInFrames' | 'fps' | 'props' | 'height' | 'width' | 'defaultCodec' | 'defaultOutName'>;
|
|
6
|
+
export type BaseMetadata = Pick<VideoConfig, 'durationInFrames' | 'fps' | 'props' | 'height' | 'width' | 'defaultCodec' | 'defaultOutName' | 'defaultVideoImageFormat' | 'defaultPixelFormat'>;
|
|
7
7
|
export type CanvasContent = {
|
|
8
8
|
type: 'composition';
|
|
9
9
|
compositionId: string;
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { Codec } from './codec.js';
|
|
|
4
4
|
import type { AnyCompMetadata, AnyComposition, AudioOrVideoAsset, TRenderAsset } from './CompositionManager.js';
|
|
5
5
|
import type { StaticFile } from './get-static-files.js';
|
|
6
6
|
import type { LogLevel } from './log.js';
|
|
7
|
+
import type { PixelFormat, VideoImageFormat } from './render-types.js';
|
|
7
8
|
import type { VideoConfig } from './video-config.js';
|
|
8
9
|
export type VideoConfigWithSerializedProps = Omit<VideoConfig, 'defaultProps' | 'props'> & {
|
|
9
10
|
serializedDefaultPropsWithCustomSchema: string;
|
|
@@ -67,6 +68,8 @@ export type BundleCompositionState = {
|
|
|
67
68
|
compositionFps: number;
|
|
68
69
|
compositionDefaultCodec: Codec;
|
|
69
70
|
compositionDefaultOutName: string | null;
|
|
71
|
+
compositionDefaultVideoImageFormat: VideoImageFormat | null;
|
|
72
|
+
compositionDefaultPixelFormat: PixelFormat | null;
|
|
70
73
|
};
|
|
71
74
|
export type BundleIndexState = {
|
|
72
75
|
type: 'index';
|
|
@@ -99,6 +102,7 @@ export { Loop } from './loop/index.js';
|
|
|
99
102
|
export { EasingFunction, ExtrapolateType, interpolate, InterpolateOptions, random, RandomSeed, } from './no-react';
|
|
100
103
|
export { prefetch, PrefetchOnProgress } from './prefetch.js';
|
|
101
104
|
export { registerRoot } from './register-root.js';
|
|
105
|
+
export type { PixelFormat, VideoImageFormat } from './render-types.js';
|
|
102
106
|
export { AbsoluteFillLayout, LayoutAndStyle, Sequence, SequenceProps, SequencePropsWithoutDuration, } from './Sequence.js';
|
|
103
107
|
export { Series } from './series/index.js';
|
|
104
108
|
export * from './spring/index.js';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const validVideoImageFormats: readonly ["png", "jpeg", "none"];
|
|
2
|
+
export type VideoImageFormat = (typeof validVideoImageFormats)[number];
|
|
3
|
+
export declare const validPixelFormats: readonly ["yuv420p", "yuva420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le", "yuv444p10le", "yuva444p10le"];
|
|
4
|
+
export type PixelFormat = (typeof validPixelFormats)[number];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Types copied from @remotion/renderer for use in core composition metadata
|
|
3
|
+
// This avoids circular dependencies while keeping renderer as the source of truth
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.validPixelFormats = exports.validVideoImageFormats = void 0;
|
|
6
|
+
exports.validVideoImageFormats = ['png', 'jpeg', 'none'];
|
|
7
|
+
exports.validPixelFormats = [
|
|
8
|
+
'yuv420p',
|
|
9
|
+
'yuva420p',
|
|
10
|
+
'yuv422p',
|
|
11
|
+
'yuv444p',
|
|
12
|
+
'yuv420p10le',
|
|
13
|
+
'yuv422p10le',
|
|
14
|
+
'yuv444p10le',
|
|
15
|
+
'yuva444p10le',
|
|
16
|
+
];
|
|
@@ -24,10 +24,21 @@ const validateCalculated = ({ calculated, compositionId, compositionFps, composi
|
|
|
24
24
|
const defaultCodec = calculated === null || calculated === void 0 ? void 0 : calculated.defaultCodec;
|
|
25
25
|
(0, validate_default_codec_js_1.validateDefaultCodec)(defaultCodec, calculateMetadataErrorLocation);
|
|
26
26
|
const defaultOutName = calculated === null || calculated === void 0 ? void 0 : calculated.defaultOutName;
|
|
27
|
-
|
|
27
|
+
const defaultVideoImageFormat = calculated === null || calculated === void 0 ? void 0 : calculated.defaultVideoImageFormat;
|
|
28
|
+
const defaultPixelFormat = calculated === null || calculated === void 0 ? void 0 : calculated.defaultPixelFormat;
|
|
29
|
+
return {
|
|
30
|
+
width,
|
|
31
|
+
height,
|
|
32
|
+
fps,
|
|
33
|
+
durationInFrames,
|
|
34
|
+
defaultCodec,
|
|
35
|
+
defaultOutName,
|
|
36
|
+
defaultVideoImageFormat,
|
|
37
|
+
defaultPixelFormat,
|
|
38
|
+
};
|
|
28
39
|
};
|
|
29
40
|
const resolveVideoConfig = ({ calculateMetadata, signal, defaultProps, originalProps, compositionId, compositionDurationInFrames, compositionFps, compositionHeight, compositionWidth, }) => {
|
|
30
|
-
var _a, _b, _c;
|
|
41
|
+
var _a, _b, _c, _d, _e;
|
|
31
42
|
const calculatedProm = calculateMetadata
|
|
32
43
|
? calculateMetadata({
|
|
33
44
|
defaultProps,
|
|
@@ -41,7 +52,7 @@ const resolveVideoConfig = ({ calculateMetadata, signal, defaultProps, originalP
|
|
|
41
52
|
'then' in calculatedProm) {
|
|
42
53
|
return calculatedProm.then((c) => {
|
|
43
54
|
var _a;
|
|
44
|
-
const { height, width, durationInFrames, fps, defaultCodec, defaultOutName, } = validateCalculated({
|
|
55
|
+
const { height, width, durationInFrames, fps, defaultCodec, defaultOutName, defaultVideoImageFormat, defaultPixelFormat, } = validateCalculated({
|
|
45
56
|
calculated: c,
|
|
46
57
|
compositionDurationInFrames,
|
|
47
58
|
compositionFps,
|
|
@@ -59,6 +70,8 @@ const resolveVideoConfig = ({ calculateMetadata, signal, defaultProps, originalP
|
|
|
59
70
|
props: (0, input_props_serialization_js_1.serializeThenDeserializeInStudio)((_a = c.props) !== null && _a !== void 0 ? _a : originalProps),
|
|
60
71
|
defaultCodec: defaultCodec !== null && defaultCodec !== void 0 ? defaultCodec : null,
|
|
61
72
|
defaultOutName: defaultOutName !== null && defaultOutName !== void 0 ? defaultOutName : null,
|
|
73
|
+
defaultVideoImageFormat: defaultVideoImageFormat !== null && defaultVideoImageFormat !== void 0 ? defaultVideoImageFormat : null,
|
|
74
|
+
defaultPixelFormat: defaultPixelFormat !== null && defaultPixelFormat !== void 0 ? defaultPixelFormat : null,
|
|
62
75
|
};
|
|
63
76
|
});
|
|
64
77
|
}
|
|
@@ -78,6 +91,8 @@ const resolveVideoConfig = ({ calculateMetadata, signal, defaultProps, originalP
|
|
|
78
91
|
props: (0, input_props_serialization_js_1.serializeThenDeserializeInStudio)(originalProps),
|
|
79
92
|
defaultCodec: null,
|
|
80
93
|
defaultOutName: null,
|
|
94
|
+
defaultVideoImageFormat: null,
|
|
95
|
+
defaultPixelFormat: null,
|
|
81
96
|
};
|
|
82
97
|
}
|
|
83
98
|
return {
|
|
@@ -87,6 +102,8 @@ const resolveVideoConfig = ({ calculateMetadata, signal, defaultProps, originalP
|
|
|
87
102
|
props: (0, input_props_serialization_js_1.serializeThenDeserializeInStudio)((_a = calculatedProm.props) !== null && _a !== void 0 ? _a : originalProps),
|
|
88
103
|
defaultCodec: (_b = calculatedProm.defaultCodec) !== null && _b !== void 0 ? _b : null,
|
|
89
104
|
defaultOutName: (_c = calculatedProm.defaultOutName) !== null && _c !== void 0 ? _c : null,
|
|
105
|
+
defaultVideoImageFormat: (_d = calculatedProm.defaultVideoImageFormat) !== null && _d !== void 0 ? _d : null,
|
|
106
|
+
defaultPixelFormat: (_e = calculatedProm.defaultPixelFormat) !== null && _e !== void 0 ? _e : null,
|
|
90
107
|
};
|
|
91
108
|
};
|
|
92
109
|
exports.resolveVideoConfig = resolveVideoConfig;
|
|
@@ -15,7 +15,7 @@ const useUnsafeVideoConfig = () => {
|
|
|
15
15
|
if (!video) {
|
|
16
16
|
return null;
|
|
17
17
|
}
|
|
18
|
-
const { id, durationInFrames, fps, height, width, defaultProps, props, defaultCodec, defaultOutName, } = video;
|
|
18
|
+
const { id, durationInFrames, fps, height, width, defaultProps, props, defaultCodec, defaultOutName, defaultVideoImageFormat, defaultPixelFormat, } = video;
|
|
19
19
|
return {
|
|
20
20
|
id,
|
|
21
21
|
width: ctxWidth !== null && ctxWidth !== void 0 ? ctxWidth : width,
|
|
@@ -26,6 +26,8 @@ const useUnsafeVideoConfig = () => {
|
|
|
26
26
|
props,
|
|
27
27
|
defaultCodec,
|
|
28
28
|
defaultOutName,
|
|
29
|
+
defaultVideoImageFormat,
|
|
30
|
+
defaultPixelFormat,
|
|
29
31
|
};
|
|
30
32
|
}, [ctxDuration, ctxHeight, ctxWidth, video]);
|
|
31
33
|
};
|
package/dist/cjs/version.d.ts
CHANGED
package/dist/cjs/version.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Codec } from './codec';
|
|
2
|
+
import type { PixelFormat, VideoImageFormat } from './render-types';
|
|
2
3
|
export type VideoConfig = {
|
|
3
4
|
width: number;
|
|
4
5
|
height: number;
|
|
@@ -9,4 +10,6 @@ export type VideoConfig = {
|
|
|
9
10
|
props: Record<string, unknown>;
|
|
10
11
|
defaultCodec: Codec | null;
|
|
11
12
|
defaultOutName: string | null;
|
|
13
|
+
defaultVideoImageFormat: VideoImageFormat | null;
|
|
14
|
+
defaultPixelFormat: PixelFormat | null;
|
|
12
15
|
};
|
package/dist/esm/index.mjs
CHANGED
|
@@ -104,7 +104,7 @@ function truthy(value) {
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
// src/version.ts
|
|
107
|
-
var VERSION = "4.0.
|
|
107
|
+
var VERSION = "4.0.317";
|
|
108
108
|
|
|
109
109
|
// src/multiple-versions-warning.ts
|
|
110
110
|
var checkMultipleRemotionVersions = () => {
|
|
@@ -642,7 +642,18 @@ var validateCalculated = ({
|
|
|
642
642
|
const defaultCodec = calculated?.defaultCodec;
|
|
643
643
|
validateDefaultCodec(defaultCodec, calculateMetadataErrorLocation);
|
|
644
644
|
const defaultOutName = calculated?.defaultOutName;
|
|
645
|
-
|
|
645
|
+
const defaultVideoImageFormat = calculated?.defaultVideoImageFormat;
|
|
646
|
+
const defaultPixelFormat = calculated?.defaultPixelFormat;
|
|
647
|
+
return {
|
|
648
|
+
width,
|
|
649
|
+
height,
|
|
650
|
+
fps,
|
|
651
|
+
durationInFrames,
|
|
652
|
+
defaultCodec,
|
|
653
|
+
defaultOutName,
|
|
654
|
+
defaultVideoImageFormat,
|
|
655
|
+
defaultPixelFormat
|
|
656
|
+
};
|
|
646
657
|
};
|
|
647
658
|
var resolveVideoConfig = ({
|
|
648
659
|
calculateMetadata,
|
|
@@ -669,7 +680,9 @@ var resolveVideoConfig = ({
|
|
|
669
680
|
durationInFrames,
|
|
670
681
|
fps,
|
|
671
682
|
defaultCodec,
|
|
672
|
-
defaultOutName
|
|
683
|
+
defaultOutName,
|
|
684
|
+
defaultVideoImageFormat,
|
|
685
|
+
defaultPixelFormat
|
|
673
686
|
} = validateCalculated({
|
|
674
687
|
calculated: c,
|
|
675
688
|
compositionDurationInFrames,
|
|
@@ -687,7 +700,9 @@ var resolveVideoConfig = ({
|
|
|
687
700
|
defaultProps: serializeThenDeserializeInStudio(defaultProps),
|
|
688
701
|
props: serializeThenDeserializeInStudio(c.props ?? originalProps),
|
|
689
702
|
defaultCodec: defaultCodec ?? null,
|
|
690
|
-
defaultOutName: defaultOutName ?? null
|
|
703
|
+
defaultOutName: defaultOutName ?? null,
|
|
704
|
+
defaultVideoImageFormat: defaultVideoImageFormat ?? null,
|
|
705
|
+
defaultPixelFormat: defaultPixelFormat ?? null
|
|
691
706
|
};
|
|
692
707
|
});
|
|
693
708
|
}
|
|
@@ -706,7 +721,9 @@ var resolveVideoConfig = ({
|
|
|
706
721
|
defaultProps: serializeThenDeserializeInStudio(defaultProps ?? {}),
|
|
707
722
|
props: serializeThenDeserializeInStudio(originalProps),
|
|
708
723
|
defaultCodec: null,
|
|
709
|
-
defaultOutName: null
|
|
724
|
+
defaultOutName: null,
|
|
725
|
+
defaultVideoImageFormat: null,
|
|
726
|
+
defaultPixelFormat: null
|
|
710
727
|
};
|
|
711
728
|
}
|
|
712
729
|
return {
|
|
@@ -715,7 +732,9 @@ var resolveVideoConfig = ({
|
|
|
715
732
|
defaultProps: serializeThenDeserializeInStudio(defaultProps ?? {}),
|
|
716
733
|
props: serializeThenDeserializeInStudio(calculatedProm.props ?? originalProps),
|
|
717
734
|
defaultCodec: calculatedProm.defaultCodec ?? null,
|
|
718
|
-
defaultOutName: calculatedProm.defaultOutName ?? null
|
|
735
|
+
defaultOutName: calculatedProm.defaultOutName ?? null,
|
|
736
|
+
defaultVideoImageFormat: calculatedProm.defaultVideoImageFormat ?? null,
|
|
737
|
+
defaultPixelFormat: calculatedProm.defaultPixelFormat ?? null
|
|
719
738
|
};
|
|
720
739
|
};
|
|
721
740
|
var resolveVideoConfigOrCatch = (params) => {
|
|
@@ -1039,7 +1058,9 @@ var useResolvedVideoConfig = (preferredCompositionId) => {
|
|
|
1039
1058
|
...typeof window === "undefined" || getRemotionEnvironment().isPlayer ? {} : getInputProps() ?? {}
|
|
1040
1059
|
},
|
|
1041
1060
|
defaultCodec: null,
|
|
1042
|
-
defaultOutName: null
|
|
1061
|
+
defaultOutName: null,
|
|
1062
|
+
defaultVideoImageFormat: null,
|
|
1063
|
+
defaultPixelFormat: null
|
|
1043
1064
|
}
|
|
1044
1065
|
};
|
|
1045
1066
|
}
|
|
@@ -1178,7 +1199,9 @@ var useUnsafeVideoConfig = () => {
|
|
|
1178
1199
|
defaultProps,
|
|
1179
1200
|
props,
|
|
1180
1201
|
defaultCodec,
|
|
1181
|
-
defaultOutName
|
|
1202
|
+
defaultOutName,
|
|
1203
|
+
defaultVideoImageFormat,
|
|
1204
|
+
defaultPixelFormat
|
|
1182
1205
|
} = video;
|
|
1183
1206
|
return {
|
|
1184
1207
|
id,
|
|
@@ -1189,7 +1212,9 @@ var useUnsafeVideoConfig = () => {
|
|
|
1189
1212
|
defaultProps,
|
|
1190
1213
|
props,
|
|
1191
1214
|
defaultCodec,
|
|
1192
|
-
defaultOutName
|
|
1215
|
+
defaultOutName,
|
|
1216
|
+
defaultVideoImageFormat,
|
|
1217
|
+
defaultPixelFormat
|
|
1193
1218
|
};
|
|
1194
1219
|
}, [ctxDuration, ctxHeight, ctxWidth, video]);
|
|
1195
1220
|
};
|
package/dist/esm/version.mjs
CHANGED
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/core"
|
|
4
4
|
},
|
|
5
5
|
"name": "remotion",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.317",
|
|
7
7
|
"description": "Make videos programmatically",
|
|
8
8
|
"main": "dist/cjs/index.js",
|
|
9
9
|
"types": "dist/cjs/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"webpack": "5.96.1",
|
|
29
29
|
"zod": "3.22.3",
|
|
30
30
|
"eslint": "9.19.0",
|
|
31
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
31
|
+
"@remotion/eslint-config-internal": "4.0.317"
|
|
32
32
|
},
|
|
33
33
|
"keywords": [
|
|
34
34
|
"remotion",
|