Embedding transparent videos
You can embed transparent videos in Remotion.
With an alpha channel
To embed a video which has an alpha channel, use the <OffthreadVideo>
component with the transparent
prop.
tsx
importReact from 'react';import {OffthreadVideo ,staticFile } from 'remotion';export constMyComp :React .FC = () => {return <OffthreadVideo src ={staticFile ('transparent.webm')}transparent />;};
tsx
importReact from 'react';import {OffthreadVideo ,staticFile } from 'remotion';export constMyComp :React .FC = () => {return <OffthreadVideo src ={staticFile ('transparent.webm')}transparent />;};
Without an alpha channel
To embed a video which does not have an alpha channel but just a black background, add mixBlendMode: "screen"
to the style
prop of the <OffthreadVideo>
component.
tsx
importReact from 'react';import {OffthreadVideo ,staticFile } from 'remotion';export constMyComp :React .FC = () => {return (<OffthreadVideo src ={staticFile ('nottransparent.mp4')}style ={{mixBlendMode : 'screen',}}/>);};
tsx
importReact from 'react';import {OffthreadVideo ,staticFile } from 'remotion';export constMyComp :React .FC = () => {return (<OffthreadVideo src ={staticFile ('nottransparent.mp4')}style ={{mixBlendMode : 'screen',}}/>);};
Greenscreen effect
To remove a background based on the color of the pixels, see the Greenscreen example.
Rendering transparent videos
To export a video with transparency, see Transparent videos