Skip to content

🎥 Make videos programmatically with React

last minute tweaks

Jonny Burger0616207a5ab5
diff --git a/packages/core/src/CompositionManager.tsx b/packages/core/src/CompositionManager.tsx
index fe029a4dc3..f40266edd5 100644
--- a/packages/core/src/CompositionManager.tsx
+++ b/packages/core/src/CompositionManager.tsx
@@ -35,8 +35,8 @@ type EnhancedTSequenceData =
type: 'video';
src: string;
volume: string | number;
- startMediaFrom: number;
doesVolumeChange: boolean;
+ startMediaFrom: number;
};
export type TSequence = {
diff --git a/packages/docs/blog/2021-04-15-remotion-2-0.md b/packages/docs/blog/2021-04-15-remotion-2-0.md
index 6adae74d78..f1c9acaba2 100644
--- a/packages/docs/blog/2021-04-15-remotion-2-0.md
+++ b/packages/docs/blog/2021-04-15-remotion-2-0.md
@@ -17,11 +17,13 @@ This is our biggest and best release so far - today we are unloading a lot of aw
</video>
</div>
-We are happy to ship really solid audio support with a really flexible API. First the basics: You can [import one or multiple audio tracks into your project, cut, trim and align them in your composition](/docs/using-audio). You can control the volume for the entirety of a track, or you can control it frame by frame and create arbitrary fade effects and much more. You can apply your React mindset - Remotion doesn't care how you render the audio tag, just that it's there. How we tell FFMPEG to mix the audio just like you hear it in the browser preview is really complex and was challenging to build - the prouder we are of the outcome!
+We are happy to ship audio support with a flexible API!
+
+You can [import one or multiple audio tracks into your project, cut, trim and align them in your composition](/docs/using-audio). The volume can be controlled for the entirety of a track, or you can control it frame by frame to create fade effects and much more. Apply your React mindset - Remotion doesn't care how you render the audio tag, just that it's there. The mechanic of how we tell FFMPEG to mix the audio just like you hear it in the browser preview is really complex and was challenging to build - we are very proud of the outcome!
## Audio visualization
-With new audio visualization APIs, you can create make your visuals react to the frequency of the audio.
+With newly introduced audio visualization APIs, you can create make your visuals react to the frequency of the audio.
What you need are the new [`getAudioData()`](/docs/get-audio-data) and [`visualizeAudio()`](/docs/visualize-audio) APIs that have been published [in it's own package](/blog/#remotionmedia-utils-package).
@@ -41,7 +43,7 @@ All of them except the last one are completely independent from the ideas of Rem
With the normal timeline, you don't see the full picture of all the media that you have placed in your composition. The reason is that the visualization you see is based on what's currently rendered at the position of your playhead.
-Introducing a new mode, the [**rich timeline**](/docs/timeline) will render additional frames other than the current one to gather enough information to visualize a full timeline.
+Introducing a new timeline mode: The [**rich timeline**](/docs/timeline) will render additional frames other than the current one to gather enough information to visualize a full timeline.
Sequences which are normally not rendered because the playback head is not within the time range of the sequence, will appear because Remotion is doing an additional render at a time where the sequence is visible.
<img src="/img/timeline.png"></img>
@@ -52,9 +54,9 @@ By default the **rich timeline** feature is disabled, but will be enabled by def
## ESBuild loader
-We have replaced the traditional transpilation of Javascript and Typescript using the `babel-loader` has been replaced by the faster `esbuild-loader` by default.
+The traditional transpilation of Javascript and Typescript using `babel-loader` has been replaced by the faster `esbuild-loader` by default.
-This will speed up bundling by a lot - hopefully you won't notice any other differences! If you for some reason need to go back to the previous behavior, you may install the [legacy babel webpack configuration](/docs/legacy-babel) and override the Webpack config.
+This will speed up bundling by a lot - hopefully you won't notice any other differences! If you for some reason need to go back to the previous behavior, you may override the Webpack config - [we are releasing a helper that makes it easy](/docs/legacy-babel).
<div>
<video width="100%" height="100%" controls playsinline autoplay="true" muted loop>
@@ -64,7 +66,7 @@ This will speed up bundling by a lot - hopefully you won't notice any other diff
## Webpack caching
-Even though transpilation is done using ESBuild now, Webpack is still used for bundling. We rely on awesome features that Webpack provides such as Hot Module Replacement, asset importing, it's strong loader ecosystem and now it's caching features.
+Even though transpilation is done using ESBuild now, Webpack is still being used for bundling. We rely on Webpack features such as Hot Module Replacement, asset importing, it's strong loader ecosystem and now it's caching features.
When you run `npm run build` for the first time, you will get a message that a cache is building. From the second time on, bundling will be much faster, even if you change your code. You shouldn't have to ever do it, but you can [opt out of caching](/docs/config#setcachingenabled).
@@ -74,11 +76,11 @@ Want to render partial video or a still for thumbnail? You can do that with Remo
`--frames=0-9` (To select the first 10 frames) or `--frames=50` (To render a still of the 51st frame).
-Learn more about [`--frames`](/docs/config#setframerange) cli options.
+Learn more about the [`--frames`](/docs/config#setframerange) CLI option.
## `@remotion/gif` component
-A new GIF component released in the `@remotion/gif` package is now available. The `<Gif />` component allows to load a local or remote GIF and synchronizes with Remotions `useCurrentFrame()`. For that it parses the GIF using WebAssembly - basically it's really cool tech! Thanks a lot to [@jeetiss](https://github.com/jeetiss) for contributing this new component.
+A new GIF component released in the `@remotion/gif` package is now available. The `<Gif />` component allows to load a local or remote GIF and synchronizes it with Remotions `useCurrentFrame()`. For that it parses the GIF using WebAssembly - basically it's really cool tech! Thanks a lot to [@jeetiss](https://github.com/jeetiss) for contributing this new component.
[Learn more about the GIF component here](/docs/gif).
@@ -88,7 +90,7 @@ In the editor, you can now resize the timeline as well as the left sidebar. Than
## interpolate()
-`interpolate()` now supports arrays with lengths that are longer than 2. Really useful - for example you can create a fade in and fade out transition with one line.
+`interpolate()` now supports arrays with lengths bigger than 2. Really useful for a lot of scenarios - for example you can create a combined fade in/fade out transition with one line.
```tsx
const opacity = interpolate(frame, [0, 10, durationInFrames - 10, durationInFrames], [0, 1, 1, 0])
@@ -100,16 +102,24 @@ While not strictly a new feature, this is definitely worth mentioning.
[Calvin Falter](https://github.com/calvin-f), [Jonas Brunner](https://github.com/j0nezz) and [Tobias Boner](https://github.com/dydent) took Remotion as their project for their university seminar and contributed over 100 tests, strengthening the code and ironing out edge cases.
-[@cnnr](https://github.com/cnnrhill) contributed a really cool test that tests the video seeking of Remotion and makes sure it is frame-accurate by matching the colors in each frame.
+[@cnnr](https://github.com/cnnrhill) contributed a really cool end-to-end test that tests the video seeking of Remotion and makes sure it is frame-accurate by matching the colors in each frame.
+
+The remaining added tests are testing the tricky parts of audio rendering. Thanks to test-driven development, we've been able to catch regressions and ship really solid audio support.
+
+The bottom line: In Remotion 1.5.4 we had total 43 tests, in Remotion 2.0 we added a total of 174 tests to come out at a total of 217.
-The remaining added tests are testing the tricky parts of audio rendering. Thanks to test-driven development, we've been able to catch regression and ship really solid audio support.
+## `<Video/>` and `<Audio/>` have `startFrom` and `endAt` props
-On Remotion 1.5.4 we had total 43 tests, in Remotion 2.0 we added a total of 174 tests to come out at a total of 217.
+These new props make it easier to cut the start or the end of the video. This is implemented using sequences, which was also possible before, but this is a convienient shorthand.
## Fixed: Frame seeking
In Remotion 1.x, a `<Video/>` would not always perfectly synchronize with Remotions time during render. This is now fixed and validated by tests that scan the color of the output frames - [however not in the most efficient way](https://github.com/JonnyBurger/remotion/issues/200). Help on improving it further is still welcome.
+## Fixed: Timeouts while importing large videos
+
+Importing files into your webpack bundle that were of significant size (the problems started at around 40MB) led to slow renders and timeouts. This is now fixed by swapping out dependencies and making sure the whole stack supports the HTTP range header well. Now if you seek a video, only the necessary parts will be loaded from the filesystem rather than the whole file being read.
+
## Breaking changes and upgrade
We've taken this opportunity of a major release to introduce some breaking changes that we think are beneficial for an awesome future of Remotion. Please take a moment to read through the [2.0 Migration guide](/docs/2-0-migration) and see if you are affected.