🎥 Make videos programmatically with React
cool icons
Jonny Burger04817bf7fe34
diff --git a/packages/cli/src/editor/components/RenderModal/RenderModal.tsx b/packages/cli/src/editor/components/RenderModal/RenderModal.tsxindex 0d2b770dc3..98c4a71c7b 100644--- a/packages/cli/src/editor/components/RenderModal/RenderModal.tsx+++ b/packages/cli/src/editor/components/RenderModal/RenderModal.tsx@@ -17,6 +17,12 @@ import React, {import {Internals} from 'remotion';import type {TComposition} from 'remotion/src/internals';import {Button} from '../../../preview-server/error-overlay/remotion-overlay/Button';+import {AudioIcon} from '../../icons/audio';+import {FileIcon} from '../../icons/file';+import {PicIcon} from '../../icons/frame';+import {GearIcon} from '../../icons/gear';+import {GifIcon} from '../../icons/gif';+import {ModalsContext} from '../../state/modals';import {Spacing} from '../layout';import {ModalContainer} from '../ModalContainer';@@ -97,7 +103,6 @@ const buttonRow: React.CSSProperties = {display: 'flex',flexDirection: 'row',justifyContent: 'flex-end',- borderTop: '1px solid black',paddingTop: 8,paddingBottom: 8,paddingLeft: 16,@@ -108,7 +113,7 @@ const scrollPanel: React.CSSProperties = {minHeight: '35vh',maxHeight: '50vh',overflow: 'auto',- minWidth: 700,+ minWidth: 650,};const horizontalLayout: React.CSSProperties = {@@ -122,8 +127,26 @@ const leftSidebar: React.CSSProperties = {const horizontalTab: React.CSSProperties = {width: 250,- display: 'block',+ display: 'flex',+ flexDirection: 'row',+ alignItems: 'center',textAlign: 'left',+ fontSize: 14,+ paddingLeft: 15,+};++const iconContainer: React.CSSProperties = {+ width: 20,+ height: 20,+ marginRight: 10,+ display: 'inline-flex',+ justifyContent: 'center',+ alignItems: 'center',+};++const icon: React.CSSProperties = {+ color: 'currentcolor',+ height: 20,};export const RenderModal: React.FC<{@@ -625,6 +648,9 @@ export const RenderModal: React.FC<{selected={tab === 'general'}onClick={() => setTab('general')}>+ <div style={iconContainer}>+ <FileIcon style={icon} />+ </div>General</Tab><Tab@@ -632,6 +658,9 @@ export const RenderModal: React.FC<{selected={tab === 'picture'}onClick={() => setTab('picture')}>+ <div style={iconContainer}>+ <PicIcon style={icon} />+ </div>Picture</Tab><Tab@@ -639,6 +668,9 @@ export const RenderModal: React.FC<{selected={tab === 'audio'}onClick={() => setTab('audio')}>+ <div style={iconContainer}>+ <AudioIcon style={icon} />+ </div>Audio</Tab>{codec === 'gif' ? (@@ -647,6 +679,9 @@ export const RenderModal: React.FC<{selected={tab === 'gif'}onClick={() => setTab('gif')}>+ <div style={iconContainer}>+ <GifIcon style={icon} />+ </div>GIF</Tab>) : null}@@ -655,6 +690,9 @@ export const RenderModal: React.FC<{selected={tab === 'advanced'}onClick={() => setTab('advanced')}>+ <div style={iconContainer}>+ <GearIcon style={icon} />+ </div>Other</Tab></div>@@ -673,6 +711,10 @@ export const RenderModal: React.FC<{setFrame={setFrame}setOutName={setOutName}setProResProfile={setProResProfile}+ endFrame={endFrame}+ setEndFrame={setEndFrame}+ setStartFrame={setStartFrame}+ startFrame={startFrame}/>) : tab === 'picture' ? (<RenderModalPicture@@ -732,12 +774,7 @@ export const RenderModal: React.FC<{minConcurrency={minConcurrency}renderMode={renderMode}setConcurrency={setConcurrency}- currentComposition={currentComposition}- endFrame={endFrame}- setEndFrame={setEndFrame}- setStartFrame={setStartFrame}setVerboseLogging={setVerboseLogging}- startFrame={startFrame}verbose={verbose}/>)}diff --git a/packages/cli/src/editor/components/RenderModal/RenderModalAdvanced.tsx b/packages/cli/src/editor/components/RenderModal/RenderModalAdvanced.tsxindex c994546436..29af057c4a 100644--- a/packages/cli/src/editor/components/RenderModal/RenderModalAdvanced.tsx+++ b/packages/cli/src/editor/components/RenderModal/RenderModalAdvanced.tsx@@ -1,9 +1,7 @@import type {ChangeEvent} from 'react';import React, {useCallback} from 'react';-import type {TComposition} from 'remotion';import {Checkbox} from '../Checkbox';-import {FrameRangeSetting} from './FrameRangeSetting';import {label, optionRow, rightRow} from './layout';import {NumberSetting} from './NumberSetting';@@ -16,25 +14,15 @@ export const RenderModalAdvanced: React.FC<{setConcurrency: React.Dispatch<React.SetStateAction<number>>;concurrency: number;setVerboseLogging: React.Dispatch<React.SetStateAction<boolean>>;- setEndFrame: React.Dispatch<React.SetStateAction<number | null>>;verbose: boolean;- startFrame: number;- currentComposition: TComposition<unknown>;- endFrame: number;- setStartFrame: React.Dispatch<React.SetStateAction<number | null>>;}> = ({renderMode,maxConcurrency,minConcurrency,setConcurrency,concurrency,- setEndFrame,setVerboseLogging,verbose,- startFrame,- currentComposition,- endFrame,- setStartFrame,}) => {const onVerboseLoggingChanged = useCallback((e: ChangeEvent<HTMLInputElement>) => {@@ -55,16 +43,6 @@ export const RenderModalAdvanced: React.FC<{value={concurrency}/>)}-- {renderMode === 'still' ? null : (- <FrameRangeSetting- durationInFrames={currentComposition.durationInFrames}- endFrame={endFrame}- setEndFrame={setEndFrame}- setStartFrame={setStartFrame}- startFrame={startFrame}- />- )}<div style={optionRow}><div style={label}>Verbose logging</div><div style={rightRow}>diff --git a/packages/cli/src/editor/components/RenderModal/RenderModalBasic.tsx b/packages/cli/src/editor/components/RenderModal/RenderModalBasic.tsxindex d3224dde94..d311cd0e38 100644--- a/packages/cli/src/editor/components/RenderModal/RenderModalBasic.tsx+++ b/packages/cli/src/editor/components/RenderModal/RenderModalBasic.tsx@@ -12,6 +12,7 @@ import {RemotionInput, RightAlignInput} from '../NewComposition/RemInput';import {ValidationMessage} from '../NewComposition/ValidationMessage';import type {SegmentedControlItem} from '../SegmentedControl';import {SegmentedControl} from '../SegmentedControl';+import {FrameRangeSetting} from './FrameRangeSetting';import {humanReadableCodec} from './human-readable-codec';import {input, label, optionRow, rightRow} from './layout';import type {RenderType} from './RenderModalAdvanced';@@ -28,6 +29,10 @@ export const RenderModalBasic: React.FC<{setFrame: React.Dispatch<React.SetStateAction<number>>;currentComposition: TComposition<unknown>;setOutName: (value: React.SetStateAction<string>) => void;+ setEndFrame: React.Dispatch<React.SetStateAction<number | null>>;+ startFrame: number;+ endFrame: number;+ setStartFrame: React.Dispatch<React.SetStateAction<number | null>>;}> = ({renderMode,imageFormatOptions,@@ -40,6 +45,10 @@ export const RenderModalBasic: React.FC<{setFrame,currentComposition,setOutName,+ setEndFrame,+ endFrame,+ setStartFrame,+ startFrame,}) => {const existence = useFileExistence(outName);@@ -111,23 +120,20 @@ export const RenderModalBasic: React.FC<{<div style={rightRow}><SegmentedControl items={imageFormatOptions} needsWrapping /></div>- <Spacing block y={1} /></div>) : (- <>- <div style={optionRow}>- <div style={label}>Codec</div>- <div style={rightRow}>- <Combobox- values={videoCodecOptions}- selectedId={codec}- title="Codec"- />- </div>+ <div style={optionRow}>+ <div style={label}>Codec</div>+ <div style={rightRow}>+ <Combobox+ values={videoCodecOptions}+ selectedId={codec}+ title="Codec"+ /></div>- <Spacing block y={1} />- </>+ </div>)}+ <Spacing block y={1} />{renderMode === 'still' && currentComposition.durationInFrames > 1 ? (<div style={optionRow}><div style={label}>Frame</div>@@ -145,7 +151,6 @@ export const RenderModalBasic: React.FC<{/></RightAlignInput></div>- <Spacing block y={1} /></div>) : null}{renderMode === 'video' && codec === 'prores' ? (@@ -156,6 +161,15 @@ export const RenderModalBasic: React.FC<{</div></div>) : null}+ {renderMode === 'still' ? null : (+ <FrameRangeSetting+ durationInFrames={currentComposition.durationInFrames}+ endFrame={endFrame}+ setEndFrame={setEndFrame}+ setStartFrame={setStartFrame}+ startFrame={startFrame}+ />+ )}<div style={optionRow}><div style={label}>Output name</div><div style={rightRow}>diff --git a/packages/cli/src/editor/icons/audio.tsx b/packages/cli/src/editor/icons/audio.tsxnew file mode 100644index 0000000000..daf9ca16f7--- /dev/null+++ b/packages/cli/src/editor/icons/audio.tsx@@ -0,0 +1,10 @@+import type {SVGProps} from 'react';++export const AudioIcon = (props: SVGProps<SVGSVGElement>) => (+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" {...props}>+ <path+ fill="currentcolor"+ d="M243 32.32C105.5 39.15 0 157.8 0 295.5v120.4C0 451.3 28.63 480 64 480h32c17.62 0 32-14.38 32-32V288c0-17.62-14.38-32-32-32H64c-10.79 0-20.8 2.9-29.72 7.7 14.2-106.8 100.5-193.9 210.4-199.4 120.5-5.965 221.7 83.92 234 199.9-9.08-5.1-19.48-8.2-30.68-8.2h-32c-17.62 0-32 14.38-32 32v160c0 17.62 14.38 32 32 32h32c35.38 0 64-28.75 64-64.13V287.9c0-145.4-122-262.88-269-255.58zM64 288h32v160H64c-17.62 0-32-14.5-32-32.13v-95.75C32 302.5 46.38 288 64 288zm416 127.9c0 17.6-14.4 32.1-32 32.1h-32V288h32c17.62 0 32 14.5 32 32.13v95.77z"+ />+ </svg>+);diff --git a/packages/cli/src/editor/icons/file.tsx b/packages/cli/src/editor/icons/file.tsxnew file mode 100644index 0000000000..f1cb08d601--- /dev/null+++ b/packages/cli/src/editor/icons/file.tsx@@ -0,0 +1,10 @@+import type {SVGProps} from 'react';++export const FileIcon = (props: SVGProps<SVGSVGElement>) => (+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512" {...props}>+ <path+ fill="currentcolor"+ d="M0 64C0 28.65 28.65 0 64 0h156.1c12.7 0 25 5.057 34 14.06L369.9 129.9c9 9 14.1 21.3 14.1 34V448c0 35.3-28.7 64-64 64H64c-35.35 0-64-28.7-64-64V64zm352 128H240c-26.5 0-48-21.5-48-48V32H64c-17.67 0-32 14.33-32 32v384c0 17.7 14.33 32 32 32h256c17.7 0 32-14.3 32-32V192zm-4.7-39.4L231.4 36.69c-2-2.07-4.6-3.51-7.4-4.21V144c0 8.8 7.2 16 16 16h111.5c-.7-2.8-2.1-5.4-4.2-7.4z"+ />+ </svg>+);diff --git a/packages/cli/src/editor/icons/frame.tsx b/packages/cli/src/editor/icons/frame.tsxnew file mode 100644index 0000000000..a2e9057d1c--- /dev/null+++ b/packages/cli/src/editor/icons/frame.tsx@@ -0,0 +1,10 @@+import type {SVGProps} from 'react';++export const PicIcon = (props: SVGProps<SVGSVGElement>) => (+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" {...props}>+ <path+ fill="currentcolor"+ d="M324.9 157.8c-11.38-17.38-39.89-17.31-51.23-.063L200.5 268.5l-16.4-22.6c-11.4-16.8-38.2-16-49.7 0l-64.52 89.16c-6.797 9.406-7.75 21.72-2.547 32C72.53 377.5 83.05 384 94.75 384h322.5c11.41 0 21.8-6.281 27.14-16.38a30.922 30.922 0 0 0-1.516-31.56L324.9 157.8zM95.8 352l62.39-87.38 29.91 41.34c3.1 4.24 8.3 7.24 13.3 6.64 5.25-.125 10.12-2.781 13.02-7.188l83.83-129.9L415 352H95.8zM447.1 32h-384C28.65 32-.01 60.65-.01 96v320c0 35.35 28.65 64 63.1 64h384c35.35 0 64-28.65 64-64V96c.01-35.35-27.79-64-63.99-64zM480 416c0 17.64-14.36 32-32 32H64c-17.64 0-32-14.36-32-32V96c0-17.64 14.36-32 32-32h384c17.64 0 32 14.36 32 32v320zM144 192c26.5 0 48-21.5 48-48s-21.5-48-48-48-48 21.5-48 48 21.5 48 48 48zm0-64c8.822 0 15.1 7.178 15.1 16s-6.3 16-15.1 16-16-7.2-16-16 7.2-16 16-16z"+ />+ </svg>+);diff --git a/packages/cli/src/editor/icons/gear.tsx b/packages/cli/src/editor/icons/gear.tsxnew file mode 100644index 0000000000..bb054325b9--- /dev/null+++ b/packages/cli/src/editor/icons/gear.tsx@@ -0,0 +1,10 @@+import type {SVGProps} from 'react';++export const GearIcon = (props: SVGProps<SVGSVGElement>) => (+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" {...props}>+ <path+ fill="currentcolor"+ d="M168 255.1c0-47.7 39.4-88 88-88s88 40.3 88 88c0 49.5-39.4 88.9-88 88.9s-88-39.4-88-88.9zm88-56c-30.9 0-56 26-56 56 0 31.8 25.1 56 56 56s56-24.2 56-56c0-30-25.1-56-56-56zM65.67 230.6l-40.33-36.8c-11.12-10.1-13.68-26.6-6.16-39.6l30.24-52.4c7.52-13.02 23.09-19.05 37.42-14.48l51.96 16.58c13.4-10.34 28.2-18.94 44-25.47l11.7-53.27C197.7 10.47 210.7 0 225.8 0h60.4c15.1 0 28.1 10.47 31.3 25.16l11.7 53.27c14.9 6.53 30.6 15.13 44 25.47l52-16.58c14.3-4.57 29.9 1.46 37.4 14.48l30.2 52.4c7.5 13 5 29.5-6.1 39.6l-40.4 36.8c1.1 8.3 1.7 16.8 1.7 24.5 0 9.5-.6 18-1.7 26.3l40.4 36.8c11.1 10.1 13.6 26.6 6.1 39.6l-30.2 52.4c-7.5 13-23.1 19-37.4 14.5l-52-16.6c-13.4 10.3-29.1 18.9-44 25.5l-11.7 53.2c-3.2 14.7-16.2 25.2-31.3 25.2h-60.4c-15.1 0-28.1-10.5-31.3-25.2l-11.7-53.2c-15.8-6.6-30.6-15.2-44-25.5l-51.96 16.6c-14.33 4.5-29.9-1.5-37.42-14.5l-30.24-52.4c-7.52-13-4.96-29.5 6.16-39.6l40.33-36.8c-1.1-8.3-1.67-16.8-1.67-26.3 0-7.7.57-16.2 1.67-24.5zm92.73-101.4-13.3 10.3-67.97-21.7-30.24 52.4 52.69 48-2.19 16.6c-.92 6.9-1.39 14-1.39 20.3 0 8.1.47 15.2 1.39 22.1l2.19 16.6-52.69 48 30.24 52.4 67.97-21.7 13.3 10.3c11.1 8.6 23.5 15.8 36.6 20.3l15.5 7.3 15.3 69.6h60.4l15.3-69.6 14.6-7.3c14-4.5 26.4-11.7 37.5-20.3l13.3-10.3 68 21.7 30.2-52.4-52.7-48 2.2-16.6c.9-6.9 1.4-14 1.4-21.2 0-7.2-.5-14.3-1.4-21.2l-2.2-16.6 52.7-48-30.2-52.4-68 21.7-13.3-10.3c-11.1-8.6-23.5-15.8-37.5-21.2l-14.6-6.4L286.2 32h-60.4l-15.3 69.6L195 108c-13.1 5.4-25.5 12.6-36.6 21.2z"+ />+ </svg>+);diff --git a/packages/cli/src/editor/icons/gif.tsx b/packages/cli/src/editor/icons/gif.tsxnew file mode 100644index 0000000000..28f8c2d6f7--- /dev/null+++ b/packages/cli/src/editor/icons/gif.tsx@@ -0,0 +1,10 @@+import type {SVGProps} from 'react';++export const GifIcon = (props: SVGProps<SVGSVGElement>) => (+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" {...props}>+ <path+ fill="currentcolor"+ d="M512 32H64C28.65 32 0 60.65 0 96v320c0 35.35 28.65 64 64 64h448c35.35 0 64-28.65 64-64V96c0-35.35-28.7-64-64-64zm32 384c0 17.64-14.36 32-32 32H64c-17.64 0-32-14.36-32-32V96c0-17.64 14.36-32 32-32h448c17.64 0 32 14.36 32 32v320zm-80-256h-96c-8.8 0-16 7.2-16 16v160c0 8.844 7.156 16 16 16s16-7.156 16-16v-64h56c8.844 0 16-7.156 16-16s-7.156-16-16-16h-56v-48h80c8.8 0 16-7.2 16-16s-7.2-16-16-16zm-160 0c-8.8 0-16 7.2-16 16v160c0 8.844 7.156 16 16 16s16-7.156 16-16V176c0-8.8-7.2-16-16-16zm-64 80h-64c-8.8 0-16 7.2-16 16s7.156 16 16 16h48v33.45c-24.83 19.91-69.13 18.16-91.48-4.203-24.95-24.95-24.95-65.55 0-90.5 25.03-25 64.19-25 89.22 0 6.25 6.25 16.38 6.25 22.62 0s6.25-16.38 0-22.62c-37.69-37.72-96.78-37.72-134.5 0-37.42 37.42-37.42 98.33 0 135.8C127.8 341.8 153.5 352 180.6 352c27.06 0 52.84-10.25 70.7-28.12 3-2.98 4.7-7.08 4.7-11.28V256c0-8.8-7.2-16-16-16z"+ />+ </svg>+);