@contractspec/lib.video-gen 2.7.17 → 2.7.19
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/browser/compositions/api-overview.js +1 -645
- package/dist/browser/compositions/index.js +1 -1133
- package/dist/browser/compositions/primitives/animated-text.js +1 -144
- package/dist/browser/compositions/primitives/brand-frame.js +1 -181
- package/dist/browser/compositions/primitives/code-block.js +1 -226
- package/dist/browser/compositions/primitives/index.js +1 -656
- package/dist/browser/compositions/primitives/progress-bar.js +1 -59
- package/dist/browser/compositions/primitives/terminal.js +1 -265
- package/dist/browser/compositions/primitives/transition.js +1 -98
- package/dist/browser/compositions/social-clip.js +1 -500
- package/dist/browser/compositions/terminal-demo.js +1 -558
- package/dist/browser/design/index.js +1 -155
- package/dist/browser/design/layouts.js +1 -50
- package/dist/browser/design/motion.js +1 -43
- package/dist/browser/design/tokens.js +1 -28
- package/dist/browser/design/typography.js +1 -61
- package/dist/browser/docs/compositions.docblock.js +1 -182
- package/dist/browser/docs/design.docblock.js +2 -17
- package/dist/browser/docs/generators.docblock.js +2 -24
- package/dist/browser/docs/rendering.docblock.js +2 -24
- package/dist/browser/docs/video-gen.docblock.js +2 -17
- package/dist/browser/generators/index.js +7 -769
- package/dist/browser/generators/scene-planner.js +7 -651
- package/dist/browser/generators/script-generator.js +7 -599
- package/dist/browser/generators/video-generator.js +7 -768
- package/dist/browser/i18n/catalogs/en.js +3 -135
- package/dist/browser/i18n/catalogs/es.js +3 -135
- package/dist/browser/i18n/catalogs/fr.js +3 -135
- package/dist/browser/i18n/catalogs/index.js +7 -387
- package/dist/browser/i18n/index.js +7 -459
- package/dist/browser/i18n/keys.js +1 -54
- package/dist/browser/i18n/locale.js +1 -21
- package/dist/browser/i18n/messages.js +7 -399
- package/dist/browser/index.js +7 -1903
- package/dist/browser/player/demo-player.js +1 -1136
- package/dist/browser/player/index.js +1 -1136
- package/dist/browser/remotion/Root.js +2 -1172
- package/dist/browser/remotion/index.js +2 -1173
- package/dist/browser/renderers/config.js +1 -40
- package/dist/browser/renderers/index.js +1 -160
- package/dist/browser/renderers/local.js +1 -156
- package/dist/browser/types.js +1 -13
- package/dist/compositions/api-overview.js +1 -639
- package/dist/compositions/index.js +1 -1127
- package/dist/compositions/primitives/animated-text.js +1 -138
- package/dist/compositions/primitives/brand-frame.js +1 -175
- package/dist/compositions/primitives/code-block.js +1 -220
- package/dist/compositions/primitives/index.js +1 -650
- package/dist/compositions/primitives/progress-bar.js +1 -53
- package/dist/compositions/primitives/terminal.js +1 -259
- package/dist/compositions/primitives/transition.js +1 -92
- package/dist/compositions/social-clip.js +1 -494
- package/dist/compositions/terminal-demo.js +1 -552
- package/dist/design/index.js +1 -149
- package/dist/design/layouts.js +1 -44
- package/dist/design/motion.js +1 -37
- package/dist/design/tokens.js +1 -22
- package/dist/design/typography.js +1 -55
- package/dist/docs/compositions.docblock.js +1 -182
- package/dist/docs/design.docblock.js +2 -17
- package/dist/docs/generators.docblock.js +2 -24
- package/dist/docs/rendering.docblock.js +2 -24
- package/dist/docs/video-gen.docblock.js +2 -17
- package/dist/generators/index.js +7 -763
- package/dist/generators/scene-planner.js +7 -645
- package/dist/generators/script-generator.js +7 -593
- package/dist/generators/video-generator.js +7 -762
- package/dist/i18n/catalogs/en.js +3 -129
- package/dist/i18n/catalogs/es.js +3 -129
- package/dist/i18n/catalogs/fr.js +3 -129
- package/dist/i18n/catalogs/index.js +7 -381
- package/dist/i18n/index.js +7 -453
- package/dist/i18n/keys.js +1 -48
- package/dist/i18n/locale.js +1 -15
- package/dist/i18n/messages.js +7 -393
- package/dist/index.js +7 -1897
- package/dist/node/compositions/api-overview.js +1 -640
- package/dist/node/compositions/index.js +1 -1128
- package/dist/node/compositions/primitives/animated-text.js +1 -139
- package/dist/node/compositions/primitives/brand-frame.js +1 -176
- package/dist/node/compositions/primitives/code-block.js +1 -221
- package/dist/node/compositions/primitives/index.js +1 -651
- package/dist/node/compositions/primitives/progress-bar.js +1 -54
- package/dist/node/compositions/primitives/terminal.js +1 -260
- package/dist/node/compositions/primitives/transition.js +1 -93
- package/dist/node/compositions/social-clip.js +1 -495
- package/dist/node/compositions/terminal-demo.js +1 -553
- package/dist/node/design/index.js +1 -150
- package/dist/node/design/layouts.js +1 -45
- package/dist/node/design/motion.js +1 -38
- package/dist/node/design/tokens.js +1 -23
- package/dist/node/design/typography.js +1 -56
- package/dist/node/docs/compositions.docblock.js +1 -182
- package/dist/node/docs/design.docblock.js +2 -17
- package/dist/node/docs/generators.docblock.js +2 -24
- package/dist/node/docs/rendering.docblock.js +2 -24
- package/dist/node/docs/video-gen.docblock.js +2 -17
- package/dist/node/generators/index.js +7 -764
- package/dist/node/generators/scene-planner.js +7 -646
- package/dist/node/generators/script-generator.js +7 -594
- package/dist/node/generators/video-generator.js +7 -763
- package/dist/node/i18n/catalogs/en.js +3 -130
- package/dist/node/i18n/catalogs/es.js +3 -130
- package/dist/node/i18n/catalogs/fr.js +3 -130
- package/dist/node/i18n/catalogs/index.js +7 -382
- package/dist/node/i18n/index.js +7 -454
- package/dist/node/i18n/keys.js +1 -49
- package/dist/node/i18n/locale.js +1 -16
- package/dist/node/i18n/messages.js +7 -394
- package/dist/node/index.js +7 -1898
- package/dist/node/player/demo-player.js +1 -1131
- package/dist/node/player/index.js +1 -1131
- package/dist/node/remotion/Root.js +2 -1167
- package/dist/node/remotion/index.js +2 -1168
- package/dist/node/renderers/config.js +1 -35
- package/dist/node/renderers/index.js +1 -155
- package/dist/node/renderers/local.js +1 -151
- package/dist/node/types.js +1 -8
- package/dist/player/demo-player.js +1 -1130
- package/dist/player/index.js +1 -1130
- package/dist/remotion/Root.js +2 -1166
- package/dist/remotion/index.js +2 -1167
- package/dist/renderers/config.js +1 -34
- package/dist/renderers/index.js +1 -154
- package/dist/renderers/local.js +1 -150
- package/dist/types.js +1 -7
- package/package.json +16 -16
package/dist/renderers/config.js
CHANGED
|
@@ -1,35 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
// src/renderers/config.ts
|
|
5
|
-
var defaultRenderConfig = {
|
|
6
|
-
codec: "h264",
|
|
7
|
-
outputFormat: "mp4",
|
|
8
|
-
crf: 18,
|
|
9
|
-
pixelFormat: "yuv420p"
|
|
10
|
-
};
|
|
11
|
-
var codecFormatMap = {
|
|
12
|
-
h264: "mp4",
|
|
13
|
-
h265: "mp4",
|
|
14
|
-
vp8: "webm",
|
|
15
|
-
vp9: "webm"
|
|
16
|
-
};
|
|
17
|
-
var qualityPresets = {
|
|
18
|
-
draft: { crf: 28, concurrency: 1 },
|
|
19
|
-
standard: { crf: 18, concurrency: undefined },
|
|
20
|
-
high: { crf: 12, concurrency: undefined }
|
|
21
|
-
};
|
|
22
|
-
function resolveRenderConfig(userConfig, preset) {
|
|
23
|
-
const presetValues = preset ? qualityPresets[preset] : {};
|
|
24
|
-
return {
|
|
25
|
-
...defaultRenderConfig,
|
|
26
|
-
...presetValues,
|
|
27
|
-
...userConfig
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
export {
|
|
31
|
-
resolveRenderConfig,
|
|
32
|
-
qualityPresets,
|
|
33
|
-
defaultRenderConfig,
|
|
34
|
-
codecFormatMap
|
|
35
|
-
};
|
|
2
|
+
var x=import.meta.require;var m={codec:"h264",outputFormat:"mp4",crf:18,pixelFormat:"yuv420p"},A={h264:"mp4",h265:"mp4",vp8:"webm",vp9:"webm"},v={draft:{crf:28,concurrency:1},standard:{crf:18,concurrency:void 0},high:{crf:12,concurrency:void 0}};function B(j,b){let k=b?v[b]:{};return{...m,...k,...j}}export{B as resolveRenderConfig,v as qualityPresets,m as defaultRenderConfig,A as codecFormatMap};
|
package/dist/renderers/index.js
CHANGED
|
@@ -1,155 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
// src/design/layouts.ts
|
|
5
|
-
import { VIDEO_FORMATS } from "@contractspec/lib.contracts-integrations/integrations/providers/video";
|
|
6
|
-
var DEFAULT_FPS = 30;
|
|
7
|
-
var videoSafeZone = {
|
|
8
|
-
horizontal: 120,
|
|
9
|
-
vertical: 80,
|
|
10
|
-
contentWidth: 1680,
|
|
11
|
-
contentHeight: 920
|
|
12
|
-
};
|
|
13
|
-
function scaleSafeZone(format) {
|
|
14
|
-
const scaleX = format.width / 1920;
|
|
15
|
-
const scaleY = format.height / 1080;
|
|
16
|
-
return {
|
|
17
|
-
horizontal: Math.round(videoSafeZone.horizontal * scaleX),
|
|
18
|
-
vertical: Math.round(videoSafeZone.vertical * scaleY),
|
|
19
|
-
contentWidth: Math.round(videoSafeZone.contentWidth * scaleX),
|
|
20
|
-
contentHeight: Math.round(videoSafeZone.contentHeight * scaleY)
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
var videoPositions = {
|
|
24
|
-
center: { x: 960, y: 540 },
|
|
25
|
-
topLeft: { x: 120, y: 80 },
|
|
26
|
-
topRight: { x: 1800, y: 80 },
|
|
27
|
-
bottomLeft: { x: 120, y: 1000 },
|
|
28
|
-
bottomRight: { x: 1800, y: 1000 },
|
|
29
|
-
bottomCenter: { x: 960, y: 960 }
|
|
30
|
-
};
|
|
31
|
-
function getAllFormatVariants() {
|
|
32
|
-
return [
|
|
33
|
-
VIDEO_FORMATS.landscape,
|
|
34
|
-
VIDEO_FORMATS.square,
|
|
35
|
-
VIDEO_FORMATS.portrait
|
|
36
|
-
];
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// src/renderers/config.ts
|
|
40
|
-
var defaultRenderConfig = {
|
|
41
|
-
codec: "h264",
|
|
42
|
-
outputFormat: "mp4",
|
|
43
|
-
crf: 18,
|
|
44
|
-
pixelFormat: "yuv420p"
|
|
45
|
-
};
|
|
46
|
-
var codecFormatMap = {
|
|
47
|
-
h264: "mp4",
|
|
48
|
-
h265: "mp4",
|
|
49
|
-
vp8: "webm",
|
|
50
|
-
vp9: "webm"
|
|
51
|
-
};
|
|
52
|
-
var qualityPresets = {
|
|
53
|
-
draft: { crf: 28, concurrency: 1 },
|
|
54
|
-
standard: { crf: 18, concurrency: undefined },
|
|
55
|
-
high: { crf: 12, concurrency: undefined }
|
|
56
|
-
};
|
|
57
|
-
function resolveRenderConfig(userConfig, preset) {
|
|
58
|
-
const presetValues = preset ? qualityPresets[preset] : {};
|
|
59
|
-
return {
|
|
60
|
-
...defaultRenderConfig,
|
|
61
|
-
...presetValues,
|
|
62
|
-
...userConfig
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// src/renderers/local.ts
|
|
67
|
-
class LocalRenderer {
|
|
68
|
-
entryPoint;
|
|
69
|
-
constructor(options) {
|
|
70
|
-
this.entryPoint = options.entryPoint;
|
|
71
|
-
}
|
|
72
|
-
async render(project, config) {
|
|
73
|
-
const resolved = resolveRenderConfig(config);
|
|
74
|
-
const { bundle } = await import("@remotion/bundler");
|
|
75
|
-
const { renderMedia, selectComposition } = await import("@remotion/renderer");
|
|
76
|
-
const bundleLocation = await bundle({
|
|
77
|
-
entryPoint: this.entryPoint
|
|
78
|
-
});
|
|
79
|
-
const firstScene = project.scenes[0];
|
|
80
|
-
const mainCompositionId = project.scenes.length === 1 && firstScene ? firstScene.compositionId : "Master";
|
|
81
|
-
const composition = await selectComposition({
|
|
82
|
-
serveUrl: bundleLocation,
|
|
83
|
-
id: mainCompositionId,
|
|
84
|
-
inputProps: {
|
|
85
|
-
project
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
await renderMedia({
|
|
89
|
-
composition,
|
|
90
|
-
serveUrl: bundleLocation,
|
|
91
|
-
codec: resolved.codec,
|
|
92
|
-
outputLocation: resolved.outputPath,
|
|
93
|
-
inputProps: { project },
|
|
94
|
-
...resolved.crf && { crf: resolved.crf },
|
|
95
|
-
...resolved.concurrency && {
|
|
96
|
-
concurrency: resolved.concurrency
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
const result = {
|
|
100
|
-
outputPath: resolved.outputPath,
|
|
101
|
-
format: resolved.outputFormat ?? defaultRenderConfig.outputFormat,
|
|
102
|
-
codec: resolved.codec ?? defaultRenderConfig.codec,
|
|
103
|
-
durationSeconds: project.totalDurationInFrames / project.fps,
|
|
104
|
-
fileSizeBytes: 0,
|
|
105
|
-
dimensions: {
|
|
106
|
-
width: project.format.width,
|
|
107
|
-
height: project.format.height
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
if (config.autoVariants) {
|
|
111
|
-
const variants = getAllFormatVariants().filter((f) => f.type !== project.format.type);
|
|
112
|
-
const variantResults = [];
|
|
113
|
-
for (const variantFormat of variants) {
|
|
114
|
-
const variantPath = resolved.outputPath.replace(/(\.[^.]+)$/, `-${variantFormat.type}$1`);
|
|
115
|
-
const variantProject = {
|
|
116
|
-
...project,
|
|
117
|
-
format: variantFormat
|
|
118
|
-
};
|
|
119
|
-
const variantComposition = await selectComposition({
|
|
120
|
-
serveUrl: bundleLocation,
|
|
121
|
-
id: mainCompositionId,
|
|
122
|
-
inputProps: { project: variantProject }
|
|
123
|
-
});
|
|
124
|
-
await renderMedia({
|
|
125
|
-
composition: variantComposition,
|
|
126
|
-
serveUrl: bundleLocation,
|
|
127
|
-
codec: resolved.codec,
|
|
128
|
-
outputLocation: variantPath,
|
|
129
|
-
inputProps: { project: variantProject },
|
|
130
|
-
...resolved.crf && { crf: resolved.crf }
|
|
131
|
-
});
|
|
132
|
-
variantResults.push({
|
|
133
|
-
outputPath: variantPath,
|
|
134
|
-
format: resolved.outputFormat ?? defaultRenderConfig.outputFormat,
|
|
135
|
-
codec: resolved.codec ?? defaultRenderConfig.codec,
|
|
136
|
-
durationSeconds: project.totalDurationInFrames / project.fps,
|
|
137
|
-
fileSizeBytes: 0,
|
|
138
|
-
dimensions: {
|
|
139
|
-
width: variantFormat.width,
|
|
140
|
-
height: variantFormat.height
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
result.variants = variantResults;
|
|
145
|
-
}
|
|
146
|
-
return result;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
export {
|
|
150
|
-
resolveRenderConfig,
|
|
151
|
-
qualityPresets,
|
|
152
|
-
defaultRenderConfig,
|
|
153
|
-
codecFormatMap,
|
|
154
|
-
LocalRenderer
|
|
155
|
-
};
|
|
2
|
+
var Y=import.meta.require;import{VIDEO_FORMATS as H}from"@contractspec/lib.contracts-integrations/integrations/providers/video";var M=30,G={horizontal:120,vertical:80,contentWidth:1680,contentHeight:920};function V(y){let Q=y.width/1920,x=y.height/1080;return{horizontal:Math.round(G.horizontal*Q),vertical:Math.round(G.vertical*x),contentWidth:Math.round(G.contentWidth*Q),contentHeight:Math.round(G.contentHeight*x)}}var b={center:{x:960,y:540},topLeft:{x:120,y:80},topRight:{x:1800,y:80},bottomLeft:{x:120,y:1000},bottomRight:{x:1800,y:1000},bottomCenter:{x:960,y:960}};function h(){return[H.landscape,H.square,H.portrait]}var k={codec:"h264",outputFormat:"mp4",crf:18,pixelFormat:"yuv420p"},_={h264:"mp4",h265:"mp4",vp8:"webm",vp9:"webm"},L={draft:{crf:28,concurrency:1},standard:{crf:18,concurrency:void 0},high:{crf:12,concurrency:void 0}};function J(y,Q){let x=Q?L[Q]:{};return{...k,...x,...y}}class P{entryPoint;constructor(y){this.entryPoint=y.entryPoint}async render(y,Q){let x=J(Q),{bundle:D}=await import("@remotion/bundler"),{renderMedia:K,selectComposition:N}=await import("@remotion/renderer"),B=await D({entryPoint:this.entryPoint}),U=y.scenes[0],W=y.scenes.length===1&&U?U.compositionId:"Master",E=await N({serveUrl:B,id:W,inputProps:{project:y}});await K({composition:E,serveUrl:B,codec:x.codec,outputLocation:x.outputPath,inputProps:{project:y},...x.crf&&{crf:x.crf},...x.concurrency&&{concurrency:x.concurrency}});let $={outputPath:x.outputPath,format:x.outputFormat??k.outputFormat,codec:x.codec??k.codec,durationSeconds:y.totalDurationInFrames/y.fps,fileSizeBytes:0,dimensions:{width:y.format.width,height:y.format.height}};if(Q.autoVariants){let T=h().filter((z)=>z.type!==y.format.type),q=[];for(let z of T){let w=x.outputPath.replace(/(\.[^.]+)$/,`-${z.type}$1`),X={...y,format:z},Z=await N({serveUrl:B,id:W,inputProps:{project:X}});await K({composition:Z,serveUrl:B,codec:x.codec,outputLocation:w,inputProps:{project:X},...x.crf&&{crf:x.crf}}),q.push({outputPath:w,format:x.outputFormat??k.outputFormat,codec:x.codec??k.codec,durationSeconds:y.totalDurationInFrames/y.fps,fileSizeBytes:0,dimensions:{width:z.width,height:z.height}})}$.variants=q}return $}}export{J as resolveRenderConfig,L as qualityPresets,k as defaultRenderConfig,_ as codecFormatMap,P as LocalRenderer};
|
package/dist/renderers/local.js
CHANGED
|
@@ -1,151 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
// src/design/layouts.ts
|
|
5
|
-
import { VIDEO_FORMATS } from "@contractspec/lib.contracts-integrations/integrations/providers/video";
|
|
6
|
-
var DEFAULT_FPS = 30;
|
|
7
|
-
var videoSafeZone = {
|
|
8
|
-
horizontal: 120,
|
|
9
|
-
vertical: 80,
|
|
10
|
-
contentWidth: 1680,
|
|
11
|
-
contentHeight: 920
|
|
12
|
-
};
|
|
13
|
-
function scaleSafeZone(format) {
|
|
14
|
-
const scaleX = format.width / 1920;
|
|
15
|
-
const scaleY = format.height / 1080;
|
|
16
|
-
return {
|
|
17
|
-
horizontal: Math.round(videoSafeZone.horizontal * scaleX),
|
|
18
|
-
vertical: Math.round(videoSafeZone.vertical * scaleY),
|
|
19
|
-
contentWidth: Math.round(videoSafeZone.contentWidth * scaleX),
|
|
20
|
-
contentHeight: Math.round(videoSafeZone.contentHeight * scaleY)
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
var videoPositions = {
|
|
24
|
-
center: { x: 960, y: 540 },
|
|
25
|
-
topLeft: { x: 120, y: 80 },
|
|
26
|
-
topRight: { x: 1800, y: 80 },
|
|
27
|
-
bottomLeft: { x: 120, y: 1000 },
|
|
28
|
-
bottomRight: { x: 1800, y: 1000 },
|
|
29
|
-
bottomCenter: { x: 960, y: 960 }
|
|
30
|
-
};
|
|
31
|
-
function getAllFormatVariants() {
|
|
32
|
-
return [
|
|
33
|
-
VIDEO_FORMATS.landscape,
|
|
34
|
-
VIDEO_FORMATS.square,
|
|
35
|
-
VIDEO_FORMATS.portrait
|
|
36
|
-
];
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// src/renderers/config.ts
|
|
40
|
-
var defaultRenderConfig = {
|
|
41
|
-
codec: "h264",
|
|
42
|
-
outputFormat: "mp4",
|
|
43
|
-
crf: 18,
|
|
44
|
-
pixelFormat: "yuv420p"
|
|
45
|
-
};
|
|
46
|
-
var codecFormatMap = {
|
|
47
|
-
h264: "mp4",
|
|
48
|
-
h265: "mp4",
|
|
49
|
-
vp8: "webm",
|
|
50
|
-
vp9: "webm"
|
|
51
|
-
};
|
|
52
|
-
var qualityPresets = {
|
|
53
|
-
draft: { crf: 28, concurrency: 1 },
|
|
54
|
-
standard: { crf: 18, concurrency: undefined },
|
|
55
|
-
high: { crf: 12, concurrency: undefined }
|
|
56
|
-
};
|
|
57
|
-
function resolveRenderConfig(userConfig, preset) {
|
|
58
|
-
const presetValues = preset ? qualityPresets[preset] : {};
|
|
59
|
-
return {
|
|
60
|
-
...defaultRenderConfig,
|
|
61
|
-
...presetValues,
|
|
62
|
-
...userConfig
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// src/renderers/local.ts
|
|
67
|
-
class LocalRenderer {
|
|
68
|
-
entryPoint;
|
|
69
|
-
constructor(options) {
|
|
70
|
-
this.entryPoint = options.entryPoint;
|
|
71
|
-
}
|
|
72
|
-
async render(project, config) {
|
|
73
|
-
const resolved = resolveRenderConfig(config);
|
|
74
|
-
const { bundle } = await import("@remotion/bundler");
|
|
75
|
-
const { renderMedia, selectComposition } = await import("@remotion/renderer");
|
|
76
|
-
const bundleLocation = await bundle({
|
|
77
|
-
entryPoint: this.entryPoint
|
|
78
|
-
});
|
|
79
|
-
const firstScene = project.scenes[0];
|
|
80
|
-
const mainCompositionId = project.scenes.length === 1 && firstScene ? firstScene.compositionId : "Master";
|
|
81
|
-
const composition = await selectComposition({
|
|
82
|
-
serveUrl: bundleLocation,
|
|
83
|
-
id: mainCompositionId,
|
|
84
|
-
inputProps: {
|
|
85
|
-
project
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
await renderMedia({
|
|
89
|
-
composition,
|
|
90
|
-
serveUrl: bundleLocation,
|
|
91
|
-
codec: resolved.codec,
|
|
92
|
-
outputLocation: resolved.outputPath,
|
|
93
|
-
inputProps: { project },
|
|
94
|
-
...resolved.crf && { crf: resolved.crf },
|
|
95
|
-
...resolved.concurrency && {
|
|
96
|
-
concurrency: resolved.concurrency
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
const result = {
|
|
100
|
-
outputPath: resolved.outputPath,
|
|
101
|
-
format: resolved.outputFormat ?? defaultRenderConfig.outputFormat,
|
|
102
|
-
codec: resolved.codec ?? defaultRenderConfig.codec,
|
|
103
|
-
durationSeconds: project.totalDurationInFrames / project.fps,
|
|
104
|
-
fileSizeBytes: 0,
|
|
105
|
-
dimensions: {
|
|
106
|
-
width: project.format.width,
|
|
107
|
-
height: project.format.height
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
if (config.autoVariants) {
|
|
111
|
-
const variants = getAllFormatVariants().filter((f) => f.type !== project.format.type);
|
|
112
|
-
const variantResults = [];
|
|
113
|
-
for (const variantFormat of variants) {
|
|
114
|
-
const variantPath = resolved.outputPath.replace(/(\.[^.]+)$/, `-${variantFormat.type}$1`);
|
|
115
|
-
const variantProject = {
|
|
116
|
-
...project,
|
|
117
|
-
format: variantFormat
|
|
118
|
-
};
|
|
119
|
-
const variantComposition = await selectComposition({
|
|
120
|
-
serveUrl: bundleLocation,
|
|
121
|
-
id: mainCompositionId,
|
|
122
|
-
inputProps: { project: variantProject }
|
|
123
|
-
});
|
|
124
|
-
await renderMedia({
|
|
125
|
-
composition: variantComposition,
|
|
126
|
-
serveUrl: bundleLocation,
|
|
127
|
-
codec: resolved.codec,
|
|
128
|
-
outputLocation: variantPath,
|
|
129
|
-
inputProps: { project: variantProject },
|
|
130
|
-
...resolved.crf && { crf: resolved.crf }
|
|
131
|
-
});
|
|
132
|
-
variantResults.push({
|
|
133
|
-
outputPath: variantPath,
|
|
134
|
-
format: resolved.outputFormat ?? defaultRenderConfig.outputFormat,
|
|
135
|
-
codec: resolved.codec ?? defaultRenderConfig.codec,
|
|
136
|
-
durationSeconds: project.totalDurationInFrames / project.fps,
|
|
137
|
-
fileSizeBytes: 0,
|
|
138
|
-
dimensions: {
|
|
139
|
-
width: variantFormat.width,
|
|
140
|
-
height: variantFormat.height
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
result.variants = variantResults;
|
|
145
|
-
}
|
|
146
|
-
return result;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
export {
|
|
150
|
-
LocalRenderer
|
|
151
|
-
};
|
|
2
|
+
var X=import.meta.require;import{VIDEO_FORMATS as K}from"@contractspec/lib.contracts-integrations/integrations/providers/video";var I=30,J={horizontal:120,vertical:80,contentWidth:1680,contentHeight:920};function V(x){let z=x.width/1920,k=x.height/1080;return{horizontal:Math.round(J.horizontal*z),vertical:Math.round(J.vertical*k),contentWidth:Math.round(J.contentWidth*z),contentHeight:Math.round(J.contentHeight*k)}}var b={center:{x:960,y:540},topLeft:{x:120,y:80},topRight:{x:1800,y:80},bottomLeft:{x:120,y:1000},bottomRight:{x:1800,y:1000},bottomCenter:{x:960,y:960}};function Y(){return[K.landscape,K.square,K.portrait]}var G={codec:"h264",outputFormat:"mp4",crf:18,pixelFormat:"yuv420p"},O={h264:"mp4",h265:"mp4",vp8:"webm",vp9:"webm"},Z={draft:{crf:28,concurrency:1},standard:{crf:18,concurrency:void 0},high:{crf:12,concurrency:void 0}};function h(x,z){let k=z?Z[z]:{};return{...G,...k,...x}}class _{entryPoint;constructor(x){this.entryPoint=x.entryPoint}async render(x,z){let k=h(z),{bundle:D}=await import("@remotion/bundler"),{renderMedia:N,selectComposition:Q}=await import("@remotion/renderer"),H=await D({entryPoint:this.entryPoint}),U=x.scenes[0],W=x.scenes.length===1&&U?U.compositionId:"Master",E=await Q({serveUrl:H,id:W,inputProps:{project:x}});await N({composition:E,serveUrl:H,codec:k.codec,outputLocation:k.outputPath,inputProps:{project:x},...k.crf&&{crf:k.crf},...k.concurrency&&{concurrency:k.concurrency}});let $={outputPath:k.outputPath,format:k.outputFormat??G.outputFormat,codec:k.codec??G.codec,durationSeconds:x.totalDurationInFrames/x.fps,fileSizeBytes:0,dimensions:{width:x.format.width,height:x.format.height}};if(z.autoVariants){let L=Y().filter((B)=>B.type!==x.format.type),w=[];for(let B of L){let q=k.outputPath.replace(/(\.[^.]+)$/,`-${B.type}$1`),y={...x,format:B},T=await Q({serveUrl:H,id:W,inputProps:{project:y}});await N({composition:T,serveUrl:H,codec:k.codec,outputLocation:q,inputProps:{project:y},...k.crf&&{crf:k.crf}}),w.push({outputPath:q,format:k.outputFormat??G.outputFormat,codec:k.codec??G.codec,durationSeconds:x.totalDurationInFrames/x.fps,fileSizeBytes:0,dimensions:{width:B.width,height:B.height}})}$.variants=w}return $}}export{_ as LocalRenderer};
|
package/dist/types.js
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
// src/types.ts
|
|
5
|
-
import { VIDEO_FORMATS } from "@contractspec/lib.contracts-integrations/integrations/providers/video";
|
|
6
|
-
export {
|
|
7
|
-
VIDEO_FORMATS
|
|
8
|
-
};
|
|
2
|
+
var f=import.meta.require;import{VIDEO_FORMATS as m}from"@contractspec/lib.contracts-integrations/integrations/providers/video";export{m as VIDEO_FORMATS};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contractspec/lib.video-gen",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.19",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -18,34 +18,34 @@
|
|
|
18
18
|
"dev": "contractspec-bun-build dev",
|
|
19
19
|
"clean": "rimraf dist .turbo",
|
|
20
20
|
"lint": "bun lint:fix",
|
|
21
|
-
"lint:fix": "biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .",
|
|
22
|
-
"lint:check": "biome check .",
|
|
21
|
+
"lint:fix": "node ../../../scripts/biome.cjs check --write --unsafe --only=nursery/useSortedClasses . && node ../../../scripts/biome.cjs check --write .",
|
|
22
|
+
"lint:check": "node ../../../scripts/biome.cjs check .",
|
|
23
23
|
"test": "bun test --pass-with-no-tests",
|
|
24
24
|
"prebuild": "contractspec-bun-build prebuild",
|
|
25
25
|
"typecheck": "tsc --noEmit"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@contractspec/lib.contracts-spec": "5.
|
|
29
|
-
"@contractspec/lib.contracts-integrations": "3.8.
|
|
28
|
+
"@contractspec/lib.contracts-spec": "5.3.0",
|
|
29
|
+
"@contractspec/lib.contracts-integrations": "3.8.11",
|
|
30
30
|
"@contractspec/lib.ai-providers": "3.7.13",
|
|
31
|
-
"@contractspec/lib.voice": "1.7.
|
|
32
|
-
"@contractspec/lib.content-gen": "3.7.
|
|
33
|
-
"@contractspec/lib.design-system": "3.
|
|
34
|
-
"@contractspec/lib.image-gen": "1.7.
|
|
35
|
-
"remotion": "^4.0.
|
|
31
|
+
"@contractspec/lib.voice": "1.7.19",
|
|
32
|
+
"@contractspec/lib.content-gen": "3.7.19",
|
|
33
|
+
"@contractspec/lib.design-system": "3.9.0",
|
|
34
|
+
"@contractspec/lib.image-gen": "1.7.19",
|
|
35
|
+
"remotion": "^4.0.447"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@contractspec/tool.typescript": "3.7.13",
|
|
39
|
-
"@contractspec/tool.bun": "3.7.
|
|
39
|
+
"@contractspec/tool.bun": "3.7.14",
|
|
40
40
|
"typescript": "^5.9.3",
|
|
41
|
-
"@remotion/bundler": "^4.0.
|
|
42
|
-
"@remotion/cli": "^4.0.
|
|
43
|
-
"@remotion/player": "^4.0.
|
|
44
|
-
"@remotion/renderer": "^4.0.
|
|
41
|
+
"@remotion/bundler": "^4.0.447",
|
|
42
|
+
"@remotion/cli": "^4.0.447",
|
|
43
|
+
"@remotion/player": "^4.0.447",
|
|
44
|
+
"@remotion/renderer": "^4.0.447",
|
|
45
45
|
"@types/react": "^19.0.0",
|
|
46
46
|
"react": "^19.2.4",
|
|
47
47
|
"react-dom": "^19.2.4",
|
|
48
|
-
"tsdown": "^0.21.
|
|
48
|
+
"tsdown": "^0.21.7"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"react": "^19.2.4",
|