Skip to content

🎥 Make videos programmatically with React

Revert brand changes from cancellation branch

Jonny Burger9e2d2c0030fe
diff --git a/bun.lock b/bun.lock
index b53274aac0..76294b99de 100644
--- a/bun.lock
+++ b/bun.lock
@@ -107,10 +107,7 @@
"name": "@remotion/brand",
"version": "4.0.527",
"dependencies": {
- "@huggingface/transformers": "4.2.0",
"@mediabunny/prores": "catalog:",
- "@remotion/video-matting": "workspace:*",
- "@remotion/whisper-webgpu": "4.0.527",
},
"devDependencies": {
"@code-hike/lighter": "1.0.3",
diff --git a/packages/brand/package.json b/packages/brand/package.json
index 0a71cf9718..713c8d298e 100644
--- a/packages/brand/package.json
+++ b/packages/brand/package.json
@@ -17,10 +17,7 @@
"render-homepage-assets": "./render-homepage-assets.sh"
},
"dependencies": {
- "@huggingface/transformers": "4.2.0",
- "@mediabunny/prores": "catalog:",
- "@remotion/video-matting": "workspace:*",
- "@remotion/whisper-webgpu": "workspace:*"
+ "@mediabunny/prores": "catalog:"
},
"devDependencies": {
"@code-hike/lighter": "1.0.3",
diff --git a/packages/brand/public/whats1-base-base.webm b/packages/brand/public/whats1-base-base.webm
deleted file mode 100644
index 65903da67c..0000000000
Binary files a/packages/brand/public/whats1-base-base.webm and /dev/null differ
diff --git a/packages/brand/public/whats1-base-foreground.webm b/packages/brand/public/whats1-base-foreground.webm
deleted file mode 100644
index a9b8c00de1..0000000000
Binary files a/packages/brand/public/whats1-base-foreground.webm and /dev/null differ
diff --git a/packages/brand/public/whats1-base.webm b/packages/brand/public/whats1-base.webm
deleted file mode 100644
index fb295ec247..0000000000
Binary files a/packages/brand/public/whats1-base.webm and /dev/null differ
diff --git a/packages/brand/public/whats1-foreground.webm b/packages/brand/public/whats1-foreground.webm
deleted file mode 100644
index 3e7605d906..0000000000
Binary files a/packages/brand/public/whats1-foreground.webm and /dev/null differ
diff --git a/packages/brand/src/announcements/whats-new-in-remotion/Scene1.tsx b/packages/brand/src/announcements/whats-new-in-remotion/Scene1.tsx
index 65f197c011..f862960157 100644
--- a/packages/brand/src/announcements/whats-new-in-remotion/Scene1.tsx
+++ b/packages/brand/src/announcements/whats-new-in-remotion/Scene1.tsx
@@ -1,9 +1,5 @@
-import {BasicCaptions} from './basic-captions.element';
-import {halftone} from '@remotion/effects/halftone';
-import {grayscale} from '@remotion/effects/grayscale';
-import {blur} from '@remotion/effects/blur';
import {Video} from '@remotion/media';
-import {AbsoluteFill, Sequence, useVideoConfig, staticFile} from 'remotion';
+import {AbsoluteFill, Sequence, useVideoConfig} from 'remotion';
import {assetUrl} from './assets';
import {SILENCES} from './Composition';
import {LowerThird} from './LowerThird';
@@ -19,99 +15,10 @@ export const Scene1: React.FC = () => {
return (
<AbsoluteFill>
<Video
- src={staticFile('whats1-base-base.webm')}
+ src={assetUrl(FILE)}
trimBefore={trimBefore}
trimAfter={trimAfter}
- effects={[blur({
- radius: 13
- }), grayscale({})]}
/>
- <BasicCaptions captions={[
- {
- "text": "Here",
- "startMs": 520,
- "endMs": 700,
- "timestampMs": 610,
- "confidence": null
- },
- {
- "text": " are",
- "startMs": 700,
- "endMs": 880,
- "timestampMs": 790,
- "confidence": null
- },
- {
- "text": " some",
- "startMs": 880,
- "endMs": 1020,
- "timestampMs": 950,
- "confidence": null
- },
- {
- "text": " of",
- "startMs": 1020,
- "endMs": 1140,
- "timestampMs": 1080,
- "confidence": null
- },
- {
- "text": " the",
- "startMs": 1140,
- "endMs": 1380,
- "timestampMs": 1260,
- "confidence": null
- },
- {
- "text": " things",
- "startMs": 1380,
- "endMs": 1560,
- "timestampMs": 1470,
- "confidence": null
- },
- {
- "text": " that",
- "startMs": 1560,
- "endMs": 1720,
- "timestampMs": 1640,
- "confidence": null
- },
- {
- "text": " we",
- "startMs": 1720,
- "endMs": 2080,
- "timestampMs": 1900,
- "confidence": null
- },
- {
- "text": " recently",
- "startMs": 2080,
- "endMs": 2640,
- "timestampMs": 2360,
- "confidence": null
- },
- {
- "text": " improved",
- "startMs": 2640,
- "endMs": 2960,
- "timestampMs": 2800,
- "confidence": null
- },
- {
- "text": " in",
- "startMs": 2960,
- "endMs": 3140,
- "timestampMs": 3050,
- "confidence": null
- },
- {
- "text": " Remotion.",
- "startMs": 3140,
- "endMs": 4000,
- "timestampMs": 3570,
- "confidence": null
- }
- ]} trimBefore={trimBefore} durationInFrames={114} />
<Sequence from={15} layout="none">
<LowerThird
name="Jonny Burger"
diff --git a/packages/brand/src/announcements/whats-new-in-remotion/basic-captions.element.tsx b/packages/brand/src/announcements/whats-new-in-remotion/basic-captions.element.tsx
deleted file mode 100644
index f936df1927..0000000000
--- a/packages/brand/src/announcements/whats-new-in-remotion/basic-captions.element.tsx
+++ /dev/null
@@ -1,174 +0,0 @@
-import type {Caption} from '@remotion/captions';
-import {createTikTokStyleCaptions} from '@remotion/captions';
-import React, {forwardRef, useImperativeHandle, useMemo, useRef} from 'react';
-import {
- Interactive,
- Sequence,
- useCurrentFrame,
- useVideoConfig,
- type InteractiveBaseProps,
- type InteractiveTransformProps,
- type InteractivitySchema,
- type SequenceControls,
- type SequenceProps,
-} from 'remotion';
-
-type BasicCaptionsProps = InteractiveBaseProps &
- InteractiveTransformProps &
- Pick<SequenceProps, 'from' | 'durationInFrames' | 'trimBefore' | 'width' | 'height'> & {
- readonly captions: Caption[];
- readonly playbackRate?: number;
- readonly combineTokensWithinMilliseconds?: number;
- };
-
-const BasicCaptionsContent: React.FC<{
- readonly captions: Caption[];
- readonly playbackRate: number;
- readonly trimBefore: number;
- readonly combineTokensWithinMilliseconds: number;
-}> = ({captions, playbackRate, trimBefore, combineTokensWithinMilliseconds}) => {
- const frame = useCurrentFrame();
- const {fps} = useVideoConfig();
- const pages = useMemo(
- () =>
- createTikTokStyleCaptions({
- captions,
- combineTokensWithinMilliseconds,
- }).pages,
- [captions, combineTokensWithinMilliseconds],
- );
- // The Sequence frame already includes trimBefore; only elapsed frames speed up.
- const currentTimeMs =
- ((trimBefore + (frame - trimBefore) * playbackRate) / fps) * 1000;
- const page = pages.find(
- (candidate) =>
- currentTimeMs >= candidate.startMs &&
- currentTimeMs < candidate.startMs + candidate.durationMs,
- );
-
- if (!page) {
- return null;
- }
-
- return (
- <div
- style={{
- backgroundColor: 'rgba(64, 64, 64, 0.75)',
- color: '#ffffff',
- display: '-webkit-box',
- fontFamily: 'Arial, Helvetica, sans-serif',
- fontSize: 64,
- fontWeight: 400,
- lineHeight: 1.2,
- overflow: 'hidden',
- padding: '14px 22px',
- textAlign: 'center',
- textWrap: 'balance',
- WebkitBoxOrient: 'vertical',
- WebkitLineClamp: 2,
- whiteSpace: 'pre-wrap',
- }}
- >
- {page.text.trim()}
- </div>
- );
-};
-
-const basicCaptionsSchema = {
- ...Interactive.baseSchema,
- ...Interactive.captionsSchema,
- width: {
- type: 'number',
- min: 1,
- step: 1,
- default: undefined,
- description: 'Caption area width',
- hiddenFromList: false,
- },
- height: {
- type: 'number',
- min: 1,
- step: 1,
- default: undefined,
- description: 'Caption area height',
- hiddenFromList: false,
- },
- combineTokensWithinMilliseconds: {
- type: 'number',
- min: 0,
- step: 50,
- default: 2000,
- description: 'Time between caption pages',
- hiddenFromList: false,
- },
- ...Interactive.transformSchema,
-} as const satisfies InteractivitySchema;
-
-const BasicCaptionsInner = forwardRef<
- HTMLDivElement,
- BasicCaptionsProps & {readonly controls: SequenceControls | undefined}
->(
- (
- {
- captions,
- combineTokensWithinMilliseconds = 2000,
- controls,
- durationInFrames,
- from,
- height = 220,
- name,
- playbackRate = 1,
- style,
- trimBefore,
- width = 900,
- ...interactiveProps
- },
- ref,
- ) => {
- const outlineRef = useRef<HTMLDivElement>(null);
- useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);
-
- return (
- <Sequence
- layout="none"
- {...interactiveProps}
- controls={controls}
- name={name ?? 'Basic captions'}
- from={from}
- durationInFrames={durationInFrames}
- trimBefore={trimBefore}
- outlineRef={outlineRef}
- >
- <div
- ref={outlineRef}
- style={{
- alignItems: 'center',
- display: 'flex',
- justifyContent: 'center',
- position: 'absolute',
- bottom: 120,
- left: '50%',
- transform: 'translateX(-50%)',
- width,
- height,
- ...style,
- }}
- >
- <BasicCaptionsContent
- captions={captions}
- combineTokensWithinMilliseconds={combineTokensWithinMilliseconds}
- playbackRate={playbackRate}
- trimBefore={trimBefore ?? 0}
- />
- </div>
- </Sequence>
- );
- },
-);
-
-export const BasicCaptions = Interactive.withSchema({
- Component: BasicCaptionsInner,
- componentName: '<BasicCaptions>',
- schema: basicCaptionsSchema,
- supportsEffects: false,
-}) as React.FC<BasicCaptionsProps>;