π₯ Make videos programmatically with React
finish 3.1 blog post
Jonny Burgerbe5e074bafaf
diff --git a/packages/docs/blog/2022-07-14-remotion-3-1.md b/packages/docs/blog/2022-07-14-remotion-3-1.mdindex 4e8bdc69af..1dee26dcf1 100644--- a/packages/docs/blog/2022-07-14-remotion-3-1.md+++ b/packages/docs/blog/2022-07-14-remotion-3-1.md@@ -5,11 +5,12 @@ author: Jonny Burgerauthor_title: Chief Hacker @ Remotionauthor_url: https://github.com/JonnyBurgerauthor_image_url: https://avatars2.githubusercontent.com/u/1629785?s=460&u=12eb94da6070d00fc924761ce06e3a428d01b7e9&v=4-image: https://remotion-still.herokuapp.com/PreviewCard.png?title=Remotion%203.0&description=@remotion/lambda,%20faster%20rendering,%20renderMedia()%20and%20React%2018+image: https://remotion-still.herokuapp.com/PreviewCard.png?title=Remotion%203.1&description=GIFs,%20%3COffthreadVideo%3E,%20Springs%20with%20duration,%20TailwindCSS---import Tabs from '@theme/Tabs';import TabItem from '@theme/TabItem';+import {SpringsWithDurationDemo} from '../components/SpringsWithDurationDemo';This relase brings support for GIF as an output format, official support for Tailwind and makes springs and sequences easier! Plus we recap the best features from v3.0.1 until v3.0.31! π@@ -23,6 +24,10 @@ This relase brings support for GIF as an output format, official support for Tai- You can even render your GIF distributed across many small VMs using Remotion Lambda!+<img style={{width: "100%"}} src="/img/render-as-gif.gif" />++<p style={{textAlign: "center"}}><em>You can put <a href="/docs/gif">{"<Gif>"}</a>'s in your GIF!</em></p>+## TailwindCSS supportAfter being broken for a while, [TailwindCSS support](/docs/tailwind) is now stable, and we even made a starter template for it! To get started, [visit our homepage](https://remotion.dev), generate a [GitHub repo from a template](https://github.com/remotion-dev/template-tailwind/generate), try it out [online via StackBlitz](https://stackblitz.com/github/remotion-dev/template-tailwind), or type the following into your terminal:@@ -60,6 +65,10 @@ yarn create video --tailwind</Tabs>+<img style={{width: "100%"}} src="/img/tailwind.gif" />++<p style={{textAlign: "center"}}><em>Yes, you can write a GIF in Tailwind now.</em></p>+## Springs with durationsYou can now do this:@@ -90,12 +99,19 @@ But to change the duration of a spring, you had to change the physics parametersUntil now - if you pass a duration to a spring, we will detect the trajectory of the curve and stretch it so it fits your duration.+<SpringsWithDurationDemo />+## `<OffthreadVideo>` component[This component](/docs/offthreadvideo) is an alternative to the [`<Video>`](/docs/video) component that extracts frames using FFMPEG and renders them inside an [`<Img>`](/docs/img) tag.We made the `<OffthreadVideo>` component in order to counteract problems with seeking and throttling that users were reporting with the `<Video>` tag. The new way improves reliability but has it's tradeoffs - read [`<OffthreadVideo> vs <Video>`](/docs/video-vs-offthreadvideo) or check out our [visual explanation on Instagram](https://www.instagram.com/p/CftaiHpMM-L/)!+<a href="https://www.instagram.com/p/CftaiHpMM-L/">+ <img src="/img/offthreadvideo-all.png" />+ <p style={{textAlign: "center"}}><em>Follow us on Instagram where we explain concepts visually!</em></p>+</a>+## `renderMedia()` returns a bufferPreviously you could only save your video to a file when using the [`renderMedia()`](/docs/renderer/render-media) and [`stitchFramesToVideo()`](/docs/renderer/stitch-frames-to-video) APIs. Now it can also return a Node.JS [`Buffer`](https://nodejs.org/api/buffer.html)!@@ -105,17 +121,24 @@ Previously you could only save your video to a file when using the [`renderMediaThis [new package](/docs/preload) offers three APIs that are handy for preloading assetsbefore they appear in the [`<Player>`](/docs/player): [`resolveRedirect()`](/docs/preload/resolve-redirect), [`preloadAudio()`](/docs/preload/preload-audio) and [`preloadVideo()`](/docs/preload/preload-video).-## Sidebar improvements+<a href="https://twitter.com/remotion_dev/status/1538809909965357056">+ <img src="/img/preload-all.png" />+ <p style={{textAlign: "center"}}><em>We first announce and explain new features on Twitter!</em></p>+</a>-You can now put your [`<Composition>`](/docs/composition)'s inside [`<Folder>`](/docs/folder)'s now to organize your left sidebar neatly!+## Sidebar improvementsIf your screen real estate is tight, you may also hide the left sidebar now!+<video src="/img/sidebar.mp4" autoPlay muted loop />+## Built-in color pickerIn the preview, go to `Tools` -> `Color picker` to trigger an eye dropper that allows you to pick any color from the screen! Only Chrome has this feature enabled for now.-## Poweruser tips+<video src="/img/colorpicker.mp4" autoPlay muted loop />++## For power users- Previously you could not wrap your `<Composition>`'s in a React context (e.g. Redux), but this is supported now!- If you add `--log=verbose` to a Lambda render, you'll see which frames took the longest to render.@@ -130,7 +153,13 @@ In the preview, go to `Tools` -> `Color picker` to trigger an eye dropper that aWe welcome Patric as our intern! As you can see on our [new team page](/about), we are now a team of three and are in the preparations of our first fundraising round.-Remotion won the "Most Exciting use of Technology Award" at React Summit - thanks to you, the users, for supporting us!+<video src="/img/patric.mp4" autoPlay muted loop />++<p style={{textAlign: "center"}}><em>Patric's first Remotion video!</em></p>++Remotion won the "Most Exciting use of Technology Award" at React Summit - we owe it all to you!++<img src="/img/award.jpeg" />Going forward, we want to make Remotion even easier to use through new tools, templates and tips!diff --git a/packages/docs/components/SpringsWithDurationDemo.tsx b/packages/docs/components/SpringsWithDurationDemo.tsxnew file mode 100644index 0000000000..9502f8e38e--- /dev/null+++ b/packages/docs/components/SpringsWithDurationDemo.tsx@@ -0,0 +1,14 @@+import { useColorMode } from "@docusaurus/theme-common";+import React from "react";++export const SpringsWithDurationDemo: React.FC = () => {+ const { isDarkTheme } = useColorMode();+ return (+ <video+ src={isDarkTheme ? "/img/springs-dark.mp4" : "/img/springs-light.mp4"}+ loop+ muted+ autoPlay+ />+ );+};diff --git a/packages/docs/static/img/award.jpeg b/packages/docs/static/img/award.jpegnew file mode 100644index 0000000000..60944a5a6cBinary files /dev/null and b/packages/docs/static/img/award.jpeg differdiff --git a/packages/docs/static/img/colorpicker.mp4 b/packages/docs/static/img/colorpicker.mp4new file mode 100644index 0000000000..d0e3641996Binary files /dev/null and b/packages/docs/static/img/colorpicker.mp4 differdiff --git a/packages/docs/static/img/offthreadvideo-all.png b/packages/docs/static/img/offthreadvideo-all.pngnew file mode 100644index 0000000000..721b4105a1Binary files /dev/null and b/packages/docs/static/img/offthreadvideo-all.png differdiff --git a/packages/docs/static/img/patric.mp4 b/packages/docs/static/img/patric.mp4new file mode 100644index 0000000000..d3de85ba9fBinary files /dev/null and b/packages/docs/static/img/patric.mp4 differdiff --git a/packages/docs/static/img/preload-all.png b/packages/docs/static/img/preload-all.pngnew file mode 100644index 0000000000..86f8c9a7d3Binary files /dev/null and b/packages/docs/static/img/preload-all.png differdiff --git a/packages/docs/static/img/render-as-gif.gif b/packages/docs/static/img/render-as-gif.gifnew file mode 100644index 0000000000..d46df83d7eBinary files /dev/null and b/packages/docs/static/img/render-as-gif.gif differdiff --git a/packages/docs/static/img/sidebar.mp4 b/packages/docs/static/img/sidebar.mp4new file mode 100644index 0000000000..2e9831a7deBinary files /dev/null and b/packages/docs/static/img/sidebar.mp4 differdiff --git a/packages/docs/static/img/springs-dark.mp4 b/packages/docs/static/img/springs-dark.mp4new file mode 100644index 0000000000..28523ded42Binary files /dev/null and b/packages/docs/static/img/springs-dark.mp4 differdiff --git a/packages/docs/static/img/springs-light.mp4 b/packages/docs/static/img/springs-light.mp4new file mode 100644index 0000000000..7036f20f2cBinary files /dev/null and b/packages/docs/static/img/springs-light.mp4 differdiff --git a/packages/docs/static/img/tailwind.gif b/packages/docs/static/img/tailwind.gifnew file mode 100644index 0000000000..d83901c509Binary files /dev/null and b/packages/docs/static/img/tailwind.gif differ