Skip to content

🎥 Make videos programmatically with React

label prores combobox

Jonny Burger24b0f1e62151
diff --git a/packages/cli/src/editor/components/RenderModal/RenderModalBasic.tsx b/packages/cli/src/editor/components/RenderModal/RenderModalBasic.tsx
index 2dde13d3c8..05a47d5ac7 100644
--- a/packages/cli/src/editor/components/RenderModal/RenderModalBasic.tsx
+++ b/packages/cli/src/editor/components/RenderModal/RenderModalBasic.tsx
@@ -2,6 +2,7 @@ import type {AudioCodec, Codec, ProResProfile} from '@remotion/renderer';
import {BrowserSafeApis} from '@remotion/renderer/client';
import React, {useCallback, useMemo} from 'react';
import type {TComposition} from 'remotion';
+import {labelProResProfile} from '../../helpers/prores-labels';
import {useFileExistence} from '../../helpers/use-file-existence';
import {Checkmark} from '../../icons/Checkmark';
import type {ComboboxValue} from '../NewComposition/ComboBox';
@@ -98,13 +99,20 @@ export const RenderModalBasic: React.FC<{
[codec, setAudioCodec]
);
- const proResProfileOptions = useMemo((): SegmentedControlItem[] => {
+ const proResProfileOptions = useMemo((): ComboboxValue[] => {
return BrowserSafeApis.proResProfileOptions.map((option) => {
return {
- label: option,
+ label: labelProResProfile(option),
onClick: () => setProResProfile(option),
key: option,
selected: proResProfile === option,
+ type: 'item',
+ id: option,
+ keyHint: null,
+ leftItem: null,
+ quickSwitcherLabel: null,
+ subMenu: null,
+ value: option,
};
});
}, [proResProfile, setProResProfile]);
@@ -195,7 +203,11 @@ export const RenderModalBasic: React.FC<{
<div style={optionRow}>
<div style={label}>ProRes profile</div>
<div style={rightRow}>
- <SegmentedControl items={proResProfileOptions} needsWrapping />
+ <Combobox
+ title={proResProfile as string}
+ selectedId={proResProfile as string}
+ values={proResProfileOptions}
+ />
</div>
</div>
) : null}
diff --git a/packages/cli/src/editor/helpers/prores-labels.ts b/packages/cli/src/editor/helpers/prores-labels.ts
new file mode 100644
index 0000000000..6b6910e1f7
--- /dev/null
+++ b/packages/cli/src/editor/helpers/prores-labels.ts
@@ -0,0 +1,29 @@
+import type {ProResProfile} from '@remotion/renderer';
+
+export const labelProResProfile = (profile: ProResProfile) => {
+ if (profile === '4444') {
+ return '4444';
+ }
+
+ if (profile === '4444-xq') {
+ return '4444 XQ (Best)';
+ }
+
+ if (profile === 'hq') {
+ return 'HQ';
+ }
+
+ if (profile === 'proxy') {
+ return 'Proxy (Worst)';
+ }
+
+ if (profile === 'light') {
+ return 'Light';
+ }
+
+ if (profile === 'standard') {
+ return 'Standard';
+ }
+
+ throw new TypeError(`Unknown ProRes profile: ${profile}`);
+};