packages/docs/docs/effects/mirror.mdx
Part of the @remotion/effects package.
A mirror effect that can be applied to canvas-based components such as <Video>, <HtmlInCanvas> and <Solid>.
import {AbsoluteFill} from 'remotion';
import {Video} from '@remotion/media';
import {mirror} from '@remotion/effects/mirror';
export const MyComp: React.FC = () => {
return (
<AbsoluteFill>
<Video
src="https://remotion.media/video.mp4"
effects={[
mirror({
direction: 'horizontal',
position: 0.5,
}),
]}
/>
</AbsoluteFill>
);
};
Pass an object with the following properties.
direction?Mirror direction. Defaults to 'horizontal'.
'horizontal' mirrors left and right. The position is interpreted on the X axis.'vertical' mirrors top and bottom. The position is interpreted on the Y axis.position?Mirror position in UV coordinates from 0 to 1. Defaults to 0.5.
invert?When true, mirrors the other side of the image. Defaults to false.
disabled?When true, the effect is skipped. Defaults to false.
mirror() uses a WebGL2 backend. During renders, enable WebGL via Config.setChromiumOpenGlRenderer('angle'). See Using WebGL during renders.