@remotion/studio 4.0.365 → 4.0.367
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/components/Modals.js +1 -1
- package/dist/components/RenderButton.js +3 -2
- package/dist/components/RenderModal/RenderModal.d.ts +7 -4
- package/dist/components/RenderModal/RenderModal.js +10 -4
- package/dist/components/RenderModal/RenderModalBasic.d.ts +4 -4
- package/dist/components/RenderQueue/actions.d.ts +3 -2
- package/dist/components/SidebarRenderButton.js +2 -1
- package/dist/components/Timeline/TimelineVideoInfo.js +12 -21
- package/dist/esm/chunk-5ywrk91r.js +59891 -0
- package/dist/esm/chunk-7e8m9pmd.js +59851 -0
- package/dist/esm/chunk-dve56fb5.js +42410 -0
- package/dist/esm/chunk-fsj6zw61.js +59894 -0
- package/dist/esm/chunk-j0sv4v53.js +59898 -0
- package/dist/esm/chunk-knnc4kgj.js +42408 -0
- package/dist/esm/chunk-q2rx70vn.js +60152 -0
- package/dist/esm/chunk-qvkzstcp.js +59855 -0
- package/dist/esm/chunk-rnxwsmc3.js +42417 -0
- package/dist/esm/chunk-xyx01n16.js +59894 -0
- package/dist/esm/chunk-y4fchsz3.js +59891 -0
- package/dist/esm/chunk-ycr2rhjx.js +42417 -0
- package/dist/esm/chunk-z4rfd84y.js +42410 -0
- package/dist/esm/internals.mjs +12064 -16831
- package/dist/esm/previewEntry.mjs +12064 -16831
- package/dist/esm/renderEntry.mjs +3 -2
- package/dist/helpers/extract-frames.d.ts +17 -0
- package/dist/helpers/extract-frames.js +62 -0
- package/dist/helpers/prores-labels.d.ts +2 -2
- package/dist/helpers/resize-video-frame.d.ts +4 -0
- package/dist/helpers/resize-video-frame.js +39 -0
- package/dist/helpers/retry-payload.js +8 -5
- package/dist/helpers/use-max-media-duration.js +14 -17
- package/dist/renderEntry.js +1 -0
- package/dist/state/modals.d.ts +7 -5
- package/package.json +10 -11
|
@@ -22,7 +22,7 @@ const Modals = ({ readOnlyStudio }) => {
|
|
|
22
22
|
const { selectedModal: modalContextType } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
23
23
|
const canRender = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).previewServerState.type ===
|
|
24
24
|
'connected';
|
|
25
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [modalContextType && modalContextType.type === 'duplicate-comp' && ((0, jsx_runtime_1.jsx)(DuplicateComposition_1.DuplicateComposition, { compositionType: modalContextType.compositionType, compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-comp' && ((0, jsx_runtime_1.jsx)(DeleteComposition_1.DeleteComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'rename-comp' && ((0, jsx_runtime_1.jsx)(RenameComposition_1.RenameComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'input-props-override' && ((0, jsx_runtime_1.jsx)(OverrideInputProps_1.OverrideInputPropsModal, {})), modalContextType && canRender && modalContextType.type === 'render' && ((0, jsx_runtime_1.jsx)(RenderModal_1.RenderModalWithLoader, { initialFrame: modalContextType.initialFrame, compositionId: modalContextType.compositionId, initialVideoImageFormat: modalContextType.initialVideoImageFormat, initialJpegQuality: modalContextType.initialJpegQuality, initialScale: modalContextType.initialScale, initialLogLevel: modalContextType.initialLogLevel, initialOffthreadVideoCacheSizeInBytes: modalContextType.initialOffthreadVideoCacheSizeInBytes, initialOffthreadVideoThreads: modalContextType.initialOffthreadVideoThreads, initialMediaCacheSizeInBytes: modalContextType.initialMediaCacheSizeInBytes, initialConcurrency: modalContextType.initialConcurrency, maxConcurrency: modalContextType.maxConcurrency, minConcurrency: modalContextType.minConcurrency, initialStillImageFormat: modalContextType.initialStillImageFormat, initialMuted: modalContextType.initialMuted, initialEnforceAudioTrack: modalContextType.initialEnforceAudioTrack, initialProResProfile: modalContextType.initialProResProfile, initialx264Preset: modalContextType.initialx264Preset, initialPixelFormat: modalContextType.initialPixelFormat, initialAudioBitrate: modalContextType.initialAudioBitrate, initialVideoBitrate: modalContextType.initialVideoBitrate, initialEveryNthFrame: modalContextType.initialEveryNthFrame, initialNumberOfGifLoops: modalContextType.initialNumberOfGifLoops, initialDelayRenderTimeout: modalContextType.initialDelayRenderTimeout, initialEnvVariables: modalContextType.initialEnvVariables, initialDisableWebSecurity: modalContextType.initialDisableWebSecurity, initialGl: modalContextType.initialOpenGlRenderer, initialHeadless: modalContextType.initialHeadless, initialIgnoreCertificateErrors: modalContextType.initialIgnoreCertificateErrors, initialEncodingBufferSize: modalContextType.initialEncodingBufferSize, initialEncodingMaxRate: modalContextType.initialEncodingMaxRate, initialUserAgent: modalContextType.initialUserAgent, initialColorSpace: modalContextType.initialColorSpace, initialMultiProcessOnLinux: modalContextType.initialMultiProcessOnLinux, initialRepro: modalContextType.initialRepro, initialBeep: modalContextType.initialBeep, initialForSeamlessAacConcatenation: modalContextType.initialForSeamlessAacConcatenation, defaultProps: modalContextType.defaultProps, inFrameMark: modalContextType.inFrameMark, outFrameMark: modalContextType.outFrameMark, defaultConfigurationAudioCodec: modalContextType.defaultConfigurationAudioCodec, defaultConfigurationVideoCodec: modalContextType.defaultConfigurationVideoCodec, renderTypeOfLastRender: modalContextType.renderTypeOfLastRender, defaultMetadata: modalContextType.defaulMetadata, initialHardwareAcceleration: modalContextType.initialHardwareAcceleration, initialChromeMode: modalContextType.initialChromeMode })), modalContextType &&
|
|
25
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [modalContextType && modalContextType.type === 'duplicate-comp' && ((0, jsx_runtime_1.jsx)(DuplicateComposition_1.DuplicateComposition, { compositionType: modalContextType.compositionType, compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-comp' && ((0, jsx_runtime_1.jsx)(DeleteComposition_1.DeleteComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'rename-comp' && ((0, jsx_runtime_1.jsx)(RenameComposition_1.RenameComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'input-props-override' && ((0, jsx_runtime_1.jsx)(OverrideInputProps_1.OverrideInputPropsModal, {})), modalContextType && canRender && modalContextType.type === 'render' && ((0, jsx_runtime_1.jsx)(RenderModal_1.RenderModalWithLoader, { initialFrame: modalContextType.initialFrame, compositionId: modalContextType.compositionId, initialVideoImageFormat: modalContextType.initialVideoImageFormat, initialJpegQuality: modalContextType.initialJpegQuality, initialScale: modalContextType.initialScale, initialLogLevel: modalContextType.initialLogLevel, initialOffthreadVideoCacheSizeInBytes: modalContextType.initialOffthreadVideoCacheSizeInBytes, initialOffthreadVideoThreads: modalContextType.initialOffthreadVideoThreads, initialMediaCacheSizeInBytes: modalContextType.initialMediaCacheSizeInBytes, initialConcurrency: modalContextType.initialConcurrency, maxConcurrency: modalContextType.maxConcurrency, minConcurrency: modalContextType.minConcurrency, initialStillImageFormat: modalContextType.initialStillImageFormat, initialMuted: modalContextType.initialMuted, initialEnforceAudioTrack: modalContextType.initialEnforceAudioTrack, initialProResProfile: modalContextType.initialProResProfile, initialx264Preset: modalContextType.initialx264Preset, initialPixelFormat: modalContextType.initialPixelFormat, initialAudioBitrate: modalContextType.initialAudioBitrate, initialVideoBitrate: modalContextType.initialVideoBitrate, initialEveryNthFrame: modalContextType.initialEveryNthFrame, initialNumberOfGifLoops: modalContextType.initialNumberOfGifLoops, initialDelayRenderTimeout: modalContextType.initialDelayRenderTimeout, initialEnvVariables: modalContextType.initialEnvVariables, initialDisableWebSecurity: modalContextType.initialDisableWebSecurity, initialGl: modalContextType.initialOpenGlRenderer, initialHeadless: modalContextType.initialHeadless, initialIgnoreCertificateErrors: modalContextType.initialIgnoreCertificateErrors, initialEncodingBufferSize: modalContextType.initialEncodingBufferSize, initialEncodingMaxRate: modalContextType.initialEncodingMaxRate, initialUserAgent: modalContextType.initialUserAgent, initialColorSpace: modalContextType.initialColorSpace, initialMultiProcessOnLinux: modalContextType.initialMultiProcessOnLinux, initialRepro: modalContextType.initialRepro, initialBeep: modalContextType.initialBeep, initialForSeamlessAacConcatenation: modalContextType.initialForSeamlessAacConcatenation, defaultProps: modalContextType.defaultProps, inFrameMark: modalContextType.inFrameMark, outFrameMark: modalContextType.outFrameMark, defaultConfigurationAudioCodec: modalContextType.defaultConfigurationAudioCodec, defaultConfigurationVideoCodec: modalContextType.defaultConfigurationVideoCodec, renderTypeOfLastRender: modalContextType.renderTypeOfLastRender, defaultMetadata: modalContextType.defaulMetadata, initialHardwareAcceleration: modalContextType.initialHardwareAcceleration, initialChromeMode: modalContextType.initialChromeMode, renderDefaults: modalContextType.renderDefaults })), modalContextType &&
|
|
26
26
|
canRender &&
|
|
27
27
|
modalContextType.type === 'render-progress' && ((0, jsx_runtime_1.jsx)(RenderStatusModal_1.RenderStatusModal, { jobId: modalContextType.jobId })), modalContextType && modalContextType.type === 'update' && ((0, jsx_runtime_1.jsx)(UpdateModal_1.UpdateModal, { info: modalContextType.info, knownBugs: modalContextType.knownBugs })), modalContextType && modalContextType.type === 'install-packages' && ((0, jsx_runtime_1.jsx)(InstallPackage_1.InstallPackageModal, { packageManager: modalContextType.packageManager })), modalContextType && modalContextType.type === 'quick-switcher' && ((0, jsx_runtime_1.jsx)(QuickSwitcher_1.default, { readOnlyStudio: readOnlyStudio, invocationTimestamp: modalContextType.invocationTimestamp, initialMode: modalContextType.mode })), (0, jsx_runtime_1.jsx)(AskAiModal_1.AskAiModal, {})] }));
|
|
28
28
|
};
|
|
@@ -55,7 +55,7 @@ const RenderButton = () => {
|
|
|
55
55
|
compositionId: video.id,
|
|
56
56
|
initialFrame: getCurrentFrame(),
|
|
57
57
|
initialStillImageFormat: defaults.stillImageFormat,
|
|
58
|
-
initialVideoImageFormat:
|
|
58
|
+
initialVideoImageFormat: null,
|
|
59
59
|
initialJpegQuality: defaults.jpegQuality,
|
|
60
60
|
initialScale: (_b = (_a = window.remotion_renderDefaults) === null || _a === void 0 ? void 0 : _a.scale) !== null && _b !== void 0 ? _b : 1,
|
|
61
61
|
initialLogLevel: defaults.logLevel,
|
|
@@ -66,7 +66,7 @@ const RenderButton = () => {
|
|
|
66
66
|
initialEnforceAudioTrack: defaults.enforceAudioTrack,
|
|
67
67
|
initialProResProfile: defaults.proResProfile,
|
|
68
68
|
initialx264Preset: defaults.x264Preset,
|
|
69
|
-
initialPixelFormat:
|
|
69
|
+
initialPixelFormat: null,
|
|
70
70
|
initialAudioBitrate: defaults.audioBitrate,
|
|
71
71
|
initialVideoBitrate: defaults.videoBitrate,
|
|
72
72
|
initialEveryNthFrame: defaults.everyNthFrame,
|
|
@@ -97,6 +97,7 @@ const RenderButton = () => {
|
|
|
97
97
|
initialHardwareAcceleration: defaults.hardwareAcceleration,
|
|
98
98
|
initialChromeMode: defaults.chromeMode,
|
|
99
99
|
initialMediaCacheSizeInBytes: defaults.mediaCacheSizeInBytes,
|
|
100
|
+
renderDefaults: defaults,
|
|
100
101
|
});
|
|
101
102
|
}, [video, setSelectedModal, getCurrentFrame, props, inFrame, outFrame]);
|
|
102
103
|
if (!video) {
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import type { AudioCodec, ChromeMode, Codec, ColorSpace, LogLevel, OpenGlRenderer, PixelFormat,
|
|
1
|
+
import type { AudioCodec, ChromeMode, Codec, ColorSpace, LogLevel, OpenGlRenderer, PixelFormat, StillImageFormat, VideoImageFormat, X264Preset } from '@remotion/renderer';
|
|
2
2
|
import type { HardwareAccelerationOption } from '@remotion/renderer/client';
|
|
3
|
+
import type { RenderDefaults } from '@remotion/studio-shared';
|
|
3
4
|
import React from 'react';
|
|
5
|
+
import type { _InternalTypes } from 'remotion';
|
|
4
6
|
import type { RenderType } from './RenderModalAdvanced';
|
|
5
7
|
type RenderModalProps = {
|
|
6
8
|
readonly compositionId: string;
|
|
7
9
|
readonly initialFrame: number;
|
|
8
|
-
readonly initialVideoImageFormat: VideoImageFormat;
|
|
10
|
+
readonly initialVideoImageFormat: VideoImageFormat | null;
|
|
9
11
|
readonly initialStillImageFormat: StillImageFormat;
|
|
10
12
|
readonly initialJpegQuality: number;
|
|
11
13
|
readonly initialScale: number;
|
|
@@ -15,9 +17,9 @@ type RenderModalProps = {
|
|
|
15
17
|
readonly maxConcurrency: number;
|
|
16
18
|
readonly initialMuted: boolean;
|
|
17
19
|
readonly initialEnforceAudioTrack: boolean;
|
|
18
|
-
readonly initialProResProfile: ProResProfile;
|
|
20
|
+
readonly initialProResProfile: _InternalTypes['ProResProfile'] | null;
|
|
19
21
|
readonly initialx264Preset: X264Preset;
|
|
20
|
-
readonly initialPixelFormat: PixelFormat;
|
|
22
|
+
readonly initialPixelFormat: PixelFormat | null;
|
|
21
23
|
readonly initialVideoBitrate: string | null;
|
|
22
24
|
readonly initialAudioBitrate: string | null;
|
|
23
25
|
readonly initialEveryNthFrame: number;
|
|
@@ -48,6 +50,7 @@ type RenderModalProps = {
|
|
|
48
50
|
readonly initialChromeMode: ChromeMode;
|
|
49
51
|
readonly initialOffthreadVideoThreads: number | null;
|
|
50
52
|
readonly defaultMetadata: Record<string, string> | null;
|
|
53
|
+
readonly renderDefaults: RenderDefaults;
|
|
51
54
|
};
|
|
52
55
|
export declare const RenderModalWithLoader: React.FC<RenderModalProps>;
|
|
53
56
|
export {};
|
|
@@ -116,7 +116,7 @@ const outer = {
|
|
|
116
116
|
display: 'flex',
|
|
117
117
|
flexDirection: 'column',
|
|
118
118
|
};
|
|
119
|
-
const RenderModal = ({ initialFrame, initialVideoImageFormat, initialStillImageFormat, initialJpegQuality, initialScale, initialLogLevel, initialConcurrency, maxConcurrency, minConcurrency, initialMuted, initialEnforceAudioTrack, initialProResProfile, initialx264Preset, initialPixelFormat, initialVideoBitrate, initialAudioBitrate, initialEveryNthFrame, initialNumberOfGifLoops, initialDelayRenderTimeout, initialOffthreadVideoCacheSizeInBytes, initialEnvVariables, initialDisableWebSecurity, initialGl, initialHeadless, initialIgnoreCertificateErrors, initialEncodingBufferSize, initialEncodingMaxRate, initialOffthreadVideoThreads, initialMediaCacheSizeInBytes, initialUserAgent, defaultProps, inFrameMark, outFrameMark, initialColorSpace, initialMultiProcessOnLinux, defaultConfigurationAudioCodec, defaultConfigurationVideoCodec, initialBeep, initialRepro, initialForSeamlessAacConcatenation, renderTypeOfLastRender, initialHardwareAcceleration, defaultMetadata, initialChromeMode, }) => {
|
|
119
|
+
const RenderModal = ({ initialFrame, initialVideoImageFormat, initialStillImageFormat, initialJpegQuality, initialScale, initialLogLevel, initialConcurrency, maxConcurrency, minConcurrency, initialMuted, initialEnforceAudioTrack, initialProResProfile, initialx264Preset, initialPixelFormat, initialVideoBitrate, initialAudioBitrate, initialEveryNthFrame, initialNumberOfGifLoops, initialDelayRenderTimeout, initialOffthreadVideoCacheSizeInBytes, initialEnvVariables, initialDisableWebSecurity, initialGl, initialHeadless, initialIgnoreCertificateErrors, initialEncodingBufferSize, initialEncodingMaxRate, initialOffthreadVideoThreads, initialMediaCacheSizeInBytes, initialUserAgent, defaultProps, inFrameMark, outFrameMark, initialColorSpace, initialMultiProcessOnLinux, defaultConfigurationAudioCodec, defaultConfigurationVideoCodec, initialBeep, initialRepro, initialForSeamlessAacConcatenation, renderTypeOfLastRender, initialHardwareAcceleration, defaultMetadata, initialChromeMode, renderDefaults, }) => {
|
|
120
120
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
121
121
|
const context = (0, react_1.useContext)(ResolveCompositionBeforeModal_1.ResolvedCompositionContext);
|
|
122
122
|
if (!context) {
|
|
@@ -141,7 +141,10 @@ const RenderModal = ({ initialFrame, initialVideoImageFormat, initialStillImageF
|
|
|
141
141
|
const [unclampedFrame, setFrame] = (0, react_1.useState)(() => initialFrame);
|
|
142
142
|
const [saving, setSaving] = (0, react_1.useState)(false);
|
|
143
143
|
const [stillImageFormat, setStillImageFormat] = (0, react_1.useState)(() => initialStillImageFormat);
|
|
144
|
-
const [videoImageFormat, setVideoImageFormat] = (0, react_1.useState)(() =>
|
|
144
|
+
const [videoImageFormat, setVideoImageFormat] = (0, react_1.useState)(() => {
|
|
145
|
+
var _a;
|
|
146
|
+
return (_a = initialVideoImageFormat !== null && initialVideoImageFormat !== void 0 ? initialVideoImageFormat : resolvedComposition.defaultVideoImageFormat) !== null && _a !== void 0 ? _a : renderDefaults.videoImageFormat;
|
|
147
|
+
});
|
|
145
148
|
const [sequenceImageFormat, setSequenceImageFormat] = (0, react_1.useState)(() => initialStillImageFormat === 'jpeg' ? 'jpeg' : 'png');
|
|
146
149
|
const [concurrency, setConcurrency] = (0, react_1.useState)(() => initialConcurrency);
|
|
147
150
|
const [videoCodecForVideoTab, setVideoCodecForVideoTab] = (0, react_1.useState)(() => initialVideoCodecForVideoTab);
|
|
@@ -202,10 +205,13 @@ const RenderModal = ({ initialFrame, initialVideoImageFormat, initialStillImageF
|
|
|
202
205
|
const [outName, setOutName] = (0, react_1.useState)(() => initialOutName);
|
|
203
206
|
const [endFrameOrNull, setEndFrame] = (0, react_1.useState)(() => outFrameMark !== null && outFrameMark !== void 0 ? outFrameMark : null);
|
|
204
207
|
const [startFrameOrNull, setStartFrame] = (0, react_1.useState)(() => inFrameMark !== null && inFrameMark !== void 0 ? inFrameMark : null);
|
|
205
|
-
const [proResProfileSetting, setProResProfile] = (0, react_1.useState)(() => initialProResProfile);
|
|
208
|
+
const [proResProfileSetting, setProResProfile] = (0, react_1.useState)(() => { var _a; return (_a = initialProResProfile !== null && initialProResProfile !== void 0 ? initialProResProfile : resolvedComposition.defaultProResProfile) !== null && _a !== void 0 ? _a : 'hq'; });
|
|
206
209
|
const [x264PresetSetting, setx264Preset] = (0, react_1.useState)(() => initialx264Preset);
|
|
207
210
|
const [hardwareAcceleration, setHardwareAcceleration] = (0, react_1.useState)(() => initialHardwareAcceleration);
|
|
208
|
-
const [userPreferredPixelFormat, setPixelFormat] = (0, react_1.useState)(() =>
|
|
211
|
+
const [userPreferredPixelFormat, setPixelFormat] = (0, react_1.useState)(() => {
|
|
212
|
+
var _a;
|
|
213
|
+
return (_a = initialPixelFormat !== null && initialPixelFormat !== void 0 ? initialPixelFormat : resolvedComposition.defaultPixelFormat) !== null && _a !== void 0 ? _a : renderDefaults.pixelFormat;
|
|
214
|
+
});
|
|
209
215
|
const [preferredQualityControlType, setQualityControl] = (0, react_1.useState)(() => initialVideoBitrate === null ? 'crf' : 'bitrate');
|
|
210
216
|
const [shouldHaveCustomTargetAudioBitrate, setShouldHaveCustomTargetAudioBitrate,] = (0, react_1.useState)(() => initialAudioBitrate !== null);
|
|
211
217
|
const [customTargetAudioBitrate, setCustomTargetAudioBitrateValue] = (0, react_1.useState)(() => initialAudioBitrate !== null && initialAudioBitrate !== void 0 ? initialAudioBitrate : '320K');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Codec, LogLevel
|
|
1
|
+
import type { Codec, LogLevel } from '@remotion/renderer';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import type { VideoConfig } from 'remotion';
|
|
3
|
+
import type { _InternalTypes, VideoConfig } from 'remotion';
|
|
4
4
|
import type { SegmentedControlItem } from '../SegmentedControl';
|
|
5
5
|
import type { RenderType } from './RenderModalAdvanced';
|
|
6
6
|
export declare const RenderModalBasic: React.FC<{
|
|
@@ -9,8 +9,8 @@ export declare const RenderModalBasic: React.FC<{
|
|
|
9
9
|
readonly codec: Codec;
|
|
10
10
|
readonly setVideoCodec: (newCodec: Codec) => void;
|
|
11
11
|
readonly outName: string;
|
|
12
|
-
readonly proResProfile: ProResProfile | null;
|
|
13
|
-
readonly setProResProfile: React.Dispatch<React.SetStateAction<ProResProfile>>;
|
|
12
|
+
readonly proResProfile: _InternalTypes['ProResProfile'] | null;
|
|
13
|
+
readonly setProResProfile: React.Dispatch<React.SetStateAction<_InternalTypes['ProResProfile']>>;
|
|
14
14
|
readonly frame: number;
|
|
15
15
|
readonly setFrame: React.Dispatch<React.SetStateAction<number>>;
|
|
16
16
|
readonly resolvedComposition: VideoConfig;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { AudioCodec, ChromeMode, Codec, ColorSpace, LogLevel, PixelFormat,
|
|
1
|
+
import type { AudioCodec, ChromeMode, Codec, ColorSpace, LogLevel, PixelFormat, StillImageFormat, VideoImageFormat, X264Preset } from '@remotion/renderer';
|
|
2
2
|
import type { HardwareAccelerationOption } from '@remotion/renderer/client';
|
|
3
3
|
import type { CanUpdateDefaultPropsResponse, EnumPath, RecastCodemod, RenderJob, RequiredChromiumOptions, VisualControlChange } from '@remotion/studio-shared';
|
|
4
|
+
import type { _InternalTypes } from 'remotion';
|
|
4
5
|
export declare const addStillRenderJob: ({ compositionId, outName, imageFormat, jpegQuality, frame, scale, logLevel, chromiumOptions, delayRenderTimeout, envVariables, inputProps, offthreadVideoCacheSizeInBytes, offthreadVideoThreads, multiProcessOnLinux, beepOnFinish, metadata, chromeMode, mediaCacheSizeInBytes, }: {
|
|
5
6
|
compositionId: string;
|
|
6
7
|
outName: string;
|
|
@@ -59,7 +60,7 @@ export declare const addVideoRenderJob: ({ compositionId, outName, imageFormat,
|
|
|
59
60
|
endFrame: number;
|
|
60
61
|
muted: boolean;
|
|
61
62
|
enforceAudioTrack: boolean;
|
|
62
|
-
proResProfile: ProResProfile | null;
|
|
63
|
+
proResProfile: _InternalTypes["ProResProfile"] | null;
|
|
63
64
|
x264Preset: X264Preset | null;
|
|
64
65
|
pixelFormat: PixelFormat;
|
|
65
66
|
audioBitrate: string | null;
|
|
@@ -47,7 +47,7 @@ const SidebarRenderButton = ({ composition, visible }) => {
|
|
|
47
47
|
initialEnforceAudioTrack: defaults.enforceAudioTrack,
|
|
48
48
|
initialProResProfile: defaults.proResProfile,
|
|
49
49
|
initialx264Preset: defaults.x264Preset,
|
|
50
|
-
initialPixelFormat:
|
|
50
|
+
initialPixelFormat: null,
|
|
51
51
|
initialAudioBitrate: defaults.audioBitrate,
|
|
52
52
|
initialVideoBitrate: defaults.videoBitrate,
|
|
53
53
|
initialEveryNthFrame: defaults.everyNthFrame,
|
|
@@ -78,6 +78,7 @@ const SidebarRenderButton = ({ composition, visible }) => {
|
|
|
78
78
|
initialHardwareAcceleration: defaults.hardwareAcceleration,
|
|
79
79
|
initialChromeMode: defaults.chromeMode,
|
|
80
80
|
initialMediaCacheSizeInBytes: defaults.mediaCacheSizeInBytes,
|
|
81
|
+
renderDefaults: defaults,
|
|
81
82
|
});
|
|
82
83
|
if (isMobileLayout) {
|
|
83
84
|
setSidebarCollapsedState({ left: 'collapsed', right: 'collapsed' });
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TimelineVideoInfo = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const media_parser_1 = require("@remotion/media-parser");
|
|
6
|
-
const webcodecs_1 = require("@remotion/webcodecs");
|
|
7
|
-
const worker_1 = require("@remotion/webcodecs/worker");
|
|
8
5
|
const react_1 = require("react");
|
|
9
6
|
const remotion_1 = require("remotion");
|
|
7
|
+
const extract_frames_1 = require("../../helpers/extract-frames");
|
|
10
8
|
const frame_database_1 = require("../../helpers/frame-database");
|
|
9
|
+
const resize_video_frame_1 = require("../../helpers/resize-video-frame");
|
|
11
10
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
12
11
|
const HEIGHT = (0, timeline_layout_1.getTimelineLayerHeight)('video') - 2;
|
|
13
12
|
const containerStyle = {
|
|
@@ -20,10 +19,11 @@ const containerStyle = {
|
|
|
20
19
|
fontSize: 10,
|
|
21
20
|
fontFamily: 'Arial, Helvetica',
|
|
22
21
|
};
|
|
23
|
-
const
|
|
22
|
+
const WEBCODECS_TIMESCALE = 1000000;
|
|
23
|
+
const MAX_TIME_DEVIATION = WEBCODECS_TIMESCALE * 0.05;
|
|
24
24
|
const getDurationOfOneFrame = ({ visualizationWidth, aspectRatio, segmentDuration, }) => {
|
|
25
25
|
const framesFitInWidthUnrounded = visualizationWidth / (HEIGHT * aspectRatio);
|
|
26
|
-
return (segmentDuration / framesFitInWidthUnrounded) *
|
|
26
|
+
return (segmentDuration / framesFitInWidthUnrounded) * WEBCODECS_TIMESCALE;
|
|
27
27
|
};
|
|
28
28
|
const fixRounding = (value) => {
|
|
29
29
|
if (value % 1 >= 0.49999999) {
|
|
@@ -41,7 +41,7 @@ const calculateTimestampSlots = ({ visualizationWidth, fromSeconds, segmentDurat
|
|
|
41
41
|
});
|
|
42
42
|
const timestampTargets = [];
|
|
43
43
|
for (let i = 0; i < framesFitInWidth + 1; i++) {
|
|
44
|
-
const target = fromSeconds *
|
|
44
|
+
const target = fromSeconds * WEBCODECS_TIMESCALE + durationOfOneFrame * (i + 0.5);
|
|
45
45
|
const snappedToDuration = (Math.round(fixRounding(target / durationOfOneFrame)) - 1) *
|
|
46
46
|
durationOfOneFrame;
|
|
47
47
|
timestampTargets.push(snappedToDuration);
|
|
@@ -68,7 +68,7 @@ const drawSlot = ({ frame, ctx, filledSlots, visualizationWidth, timestamp, segm
|
|
|
68
68
|
aspectRatio: frame.displayWidth / frame.displayHeight,
|
|
69
69
|
segmentDuration,
|
|
70
70
|
});
|
|
71
|
-
const relativeTimestamp = timestamp - fromSeconds *
|
|
71
|
+
const relativeTimestamp = timestamp - fromSeconds * WEBCODECS_TIMESCALE;
|
|
72
72
|
const frameIndex = relativeTimestamp / durationOfOneFrame;
|
|
73
73
|
const left = Math.floor((frameIndex * frame.displayWidth) / window.devicePixelRatio); // round to avoid antialiasing
|
|
74
74
|
ctx.drawImage(frame, left, 0, frame.displayWidth / window.devicePixelRatio, frame.displayHeight / window.devicePixelRatio);
|
|
@@ -189,9 +189,8 @@ const TimelineVideoInfo = ({ src, visualizationWidth, startFrom, durationInFrame
|
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
(0, frame_database_1.clearOldFrames)();
|
|
192
|
-
(0,
|
|
193
|
-
|
|
194
|
-
timestampsInSeconds: ({ track }) => {
|
|
192
|
+
(0, extract_frames_1.extractFrames)({
|
|
193
|
+
timestampsInSeconds: ({ track, }) => {
|
|
195
194
|
aspectRatio.current = track.width / track.height;
|
|
196
195
|
frame_database_1.aspectRatioCache.set(src, aspectRatio.current);
|
|
197
196
|
ensureSlots({
|
|
@@ -201,19 +200,14 @@ const TimelineVideoInfo = ({ src, visualizationWidth, startFrom, durationInFrame
|
|
|
201
200
|
visualizationWidth,
|
|
202
201
|
aspectRatio: aspectRatio.current,
|
|
203
202
|
});
|
|
204
|
-
return Array.from(filledSlots.keys()).map((timestamp) => timestamp /
|
|
203
|
+
return Array.from(filledSlots.keys()).map((timestamp) => timestamp / WEBCODECS_TIMESCALE);
|
|
205
204
|
},
|
|
206
205
|
src,
|
|
207
206
|
onFrame: (frame) => {
|
|
208
207
|
const scale = (HEIGHT / frame.displayHeight) * window.devicePixelRatio;
|
|
209
|
-
const transformed = (0,
|
|
208
|
+
const transformed = (0, resize_video_frame_1.resizeVideoFrame)({
|
|
210
209
|
frame,
|
|
211
|
-
|
|
212
|
-
mode: 'scale',
|
|
213
|
-
scale,
|
|
214
|
-
},
|
|
215
|
-
rotation: 0,
|
|
216
|
-
needsToBeMultipleOfTwo: false,
|
|
210
|
+
scale,
|
|
217
211
|
});
|
|
218
212
|
if (transformed !== frame) {
|
|
219
213
|
frame.close();
|
|
@@ -259,9 +253,6 @@ const TimelineVideoInfo = ({ src, visualizationWidth, startFrom, durationInFrame
|
|
|
259
253
|
});
|
|
260
254
|
})
|
|
261
255
|
.catch((e) => {
|
|
262
|
-
if ((0, media_parser_1.hasBeenAborted)(e)) {
|
|
263
|
-
return;
|
|
264
|
-
}
|
|
265
256
|
setError(e);
|
|
266
257
|
})
|
|
267
258
|
.finally(() => {
|