🎥 Make videos programmatically with React
`@remotion/studio`: Retrying a still will default to a still again
Jonny Burgera2090ca8f143
diff --git a/packages/studio/src/components/Modals.tsx b/packages/studio/src/components/Modals.tsxindex 66db28d7a8..7d5da3e89b 100644--- a/packages/studio/src/components/Modals.tsx+++ b/packages/studio/src/components/Modals.tsx@@ -10,7 +10,7 @@ import {RenderStatusModal} from './RenderModal/RenderStatusModal';import {UpdateModal} from './UpdateModal/UpdateModal';export const Modals: React.FC<{- readOnlyStudio: boolean;+ readonly readOnlyStudio: boolean;}> = ({readOnlyStudio}) => {const {selectedModal: modalContextType} = useContext(ModalsContext);const canRender =@@ -82,6 +82,7 @@ export const Modals: React.FC<{defaultConfigurationVideoCodec={modalContextType.defaultConfigurationVideoCodec}+ renderTypeOfLastRender={modalContextType.renderTypeOfLastRender}/>)}diff --git a/packages/studio/src/components/RenderButton.tsx b/packages/studio/src/components/RenderButton.tsxindex 2ee6f6e985..2048d5e486 100644--- a/packages/studio/src/components/RenderButton.tsx+++ b/packages/studio/src/components/RenderButton.tsx@@ -109,6 +109,7 @@ export const RenderButton: React.FC = () => {initialBeep: defaults.beepOnFinish,initialRepro: defaults.repro,initialForSeamlessAacConcatenation: defaults.forSeamlessAacConcatenation,+ renderTypeOfLastRender: null,});}, [video, setSelectedModal, frame, props, inFrame, outFrame]);diff --git a/packages/studio/src/components/RenderModal/RenderModal.tsx b/packages/studio/src/components/RenderModal/RenderModal.tsxindex d4812473dd..da61b5347e 100644--- a/packages/studio/src/components/RenderModal/RenderModal.tsx+++ b/packages/studio/src/components/RenderModal/RenderModal.tsx@@ -195,50 +195,51 @@ const outer: React.CSSProperties = {};type RenderModalProps = {- compositionId: string;- initialFrame: number;- initialVideoImageFormat: VideoImageFormat;- initialStillImageFormat: StillImageFormat;- initialJpegQuality: number;- initialScale: number;- initialLogLevel: LogLevel;- initialConcurrency: number;- minConcurrency: number;- maxConcurrency: number;- initialMuted: boolean;- initialEnforceAudioTrack: boolean;- initialProResProfile: ProResProfile;- initialx264Preset: X264Preset;- initialPixelFormat: PixelFormat;- initialVideoBitrate: string | null;- initialAudioBitrate: string | null;- initialEveryNthFrame: number;- initialNumberOfGifLoops: number | null;- initialDelayRenderTimeout: number;- initialEnvVariables: Record<string, string>;- initialDisableWebSecurity: boolean;- initialGl: OpenGlRenderer | null;- initialIgnoreCertificateErrors: boolean;- initialOffthreadVideoCacheSizeInBytes: number | null;- initialHeadless: boolean;- initialColorSpace: ColorSpace;- initialEncodingMaxRate: string | null;- initialEncodingBufferSize: string | null;- initialUserAgent: string | null;- initialBeep: boolean;- initialRepro: boolean;- defaultProps: Record<string, unknown>;- inFrameMark: number | null;- outFrameMark: number | null;- initialMultiProcessOnLinux: boolean;- defaultConfigurationVideoCodec: Codec | null;- defaultConfigurationAudioCodec: AudioCodec | null;- initialForSeamlessAacConcatenation: boolean;+ readonly compositionId: string;+ readonly initialFrame: number;+ readonly initialVideoImageFormat: VideoImageFormat;+ readonly initialStillImageFormat: StillImageFormat;+ readonly initialJpegQuality: number;+ readonly initialScale: number;+ readonly initialLogLevel: LogLevel;+ readonly initialConcurrency: number;+ readonly minConcurrency: number;+ readonly maxConcurrency: number;+ readonly initialMuted: boolean;+ readonly initialEnforceAudioTrack: boolean;+ readonly initialProResProfile: ProResProfile;+ readonly initialx264Preset: X264Preset;+ readonly initialPixelFormat: PixelFormat;+ readonly initialVideoBitrate: string | null;+ readonly initialAudioBitrate: string | null;+ readonly initialEveryNthFrame: number;+ readonly initialNumberOfGifLoops: number | null;+ readonly initialDelayRenderTimeout: number;+ readonly initialEnvVariables: Record<string, string>;+ readonly initialDisableWebSecurity: boolean;+ readonly initialGl: OpenGlRenderer | null;+ readonly initialIgnoreCertificateErrors: boolean;+ readonly initialOffthreadVideoCacheSizeInBytes: number | null;+ readonly initialHeadless: boolean;+ readonly initialColorSpace: ColorSpace;+ readonly initialEncodingMaxRate: string | null;+ readonly initialEncodingBufferSize: string | null;+ readonly initialUserAgent: string | null;+ readonly initialBeep: boolean;+ readonly initialRepro: boolean;+ readonly defaultProps: Record<string, unknown>;+ readonly inFrameMark: number | null;+ readonly outFrameMark: number | null;+ readonly initialMultiProcessOnLinux: boolean;+ readonly defaultConfigurationVideoCodec: Codec | null;+ readonly defaultConfigurationAudioCodec: AudioCodec | null;+ readonly initialForSeamlessAacConcatenation: boolean;+ readonly renderTypeOfLastRender: RenderType | null;};const RenderModal: React.FC<Omit<RenderModalProps, 'compositionId'> & {- defaultConfigurationVideoCodec: Codec | null;+ readonly defaultConfigurationVideoCodec: Codec | null;}> = ({initialFrame,@@ -279,6 +280,7 @@ const RenderModal: React.FC<initialBeep,initialRepro,initialForSeamlessAacConcatenation,+ renderTypeOfLastRender,}) => {const {setSelectedModal} = useContext(ModalsContext);@@ -315,7 +317,7 @@ const RenderModal: React.FC<defaultConfigurationVideoCodec,compositionDefaultVideoCodec: resolvedComposition.defaultCodec,defaultConfigurationAudioCodec,- renderType: isVideo ? 'video' : 'still',+ renderType: renderTypeOfLastRender ?? (isVideo ? 'video' : 'still'),});});@@ -349,12 +351,15 @@ const RenderModal: React.FC<const [initialOutName] = useState(() => {return getDefaultOutLocation({compositionName: resolvedComposition.id,- defaultExtension: isVideo- ? BrowserSafeApis.getFileExtensionFromCodec(- initialVideoCodec,- initialAudioCodec,- )- : initialStillImageFormat,+ defaultExtension:+ initialRenderType === 'still'+ ? initialStillImageFormat+ : isVideo+ ? BrowserSafeApis.getFileExtensionFromCodec(+ initialVideoCodec,+ initialAudioCodec,+ )+ : initialStillImageFormat,type: 'asset',});});diff --git a/packages/studio/src/components/SidebarRenderButton.tsx b/packages/studio/src/components/SidebarRenderButton.tsxindex 3d6b29ca0f..2308996a06 100644--- a/packages/studio/src/components/SidebarRenderButton.tsx+++ b/packages/studio/src/components/SidebarRenderButton.tsx@@ -91,6 +91,7 @@ export const SidebarRenderButton: React.FC<{initialRepro: defaults.repro,initialForSeamlessAacConcatenation:defaults.forSeamlessAacConcatenation,+ renderTypeOfLastRender: null,});if (isMobileLayout) {diff --git a/packages/studio/src/helpers/retry-payload.ts b/packages/studio/src/helpers/retry-payload.tsindex 28416bfe79..e0909a9e15 100644--- a/packages/studio/src/helpers/retry-payload.ts+++ b/packages/studio/src/helpers/retry-payload.ts@@ -61,6 +61,7 @@ export const makeRetryPayload = (job: RenderJob): RenderModalState => {initialBeep: job.beepOnFinish,initialRepro: job.repro,initialForSeamlessAacConcatenation: defaults.forSeamlessAacConcatenation,+ renderTypeOfLastRender: 'still',};}@@ -109,6 +110,7 @@ export const makeRetryPayload = (job: RenderJob): RenderModalState => {initialBeep: job.beepOnFinish,initialRepro: job.repro,initialForSeamlessAacConcatenation: defaults.forSeamlessAacConcatenation,+ renderTypeOfLastRender: 'sequence',};}@@ -158,6 +160,7 @@ export const makeRetryPayload = (job: RenderJob): RenderModalState => {initialBeep: job.beepOnFinish,initialRepro: job.repro,initialForSeamlessAacConcatenation: job.forSeamlessAacConcatenation,+ renderTypeOfLastRender: 'video',};}diff --git a/packages/studio/src/state/modals.ts b/packages/studio/src/state/modals.tsindex ab471ac6ef..b3fa033ae3 100644--- a/packages/studio/src/state/modals.ts+++ b/packages/studio/src/state/modals.ts@@ -13,6 +13,7 @@ import type {import type React from 'react';import {createContext} from 'react';import type {QuickSwitcherMode} from '../components/QuickSwitcher/NoResults';+import type {RenderType} from '../components/RenderModal/RenderModalAdvanced';import type {Bug, UpdateInfo} from '../components/UpdateCheck';export type RenderModalState = {@@ -56,6 +57,7 @@ export type RenderModalState = {outFrameMark: number | null;defaultConfigurationVideoCodec: Codec;defaultConfigurationAudioCodec: AudioCodec | null;+ renderTypeOfLastRender: RenderType | null;};export type ModalState =