Skip to main content

嵌入透明视频

你可以在 Remotion 中嵌入透明视频。

🌐 You can embed transparent videos in Remotion.

带有 alpha 通道

🌐 With an alpha channel

要嵌入具有 alpha 通道的视频,请使用带有 transparent 属性的 <OffthreadVideo> 组件。

🌐 To embed a video which has an alpha channel, use the <OffthreadVideo> component with the transparent prop.

import React from 'react';
import {OffthreadVideo, staticFile} from 'remotion';

export const MyComp: React.FC = () => {
  return <OffthreadVideo src={staticFile('transparent.webm')} transparent />;
};

没有 alpha 通道

🌐 Without an alpha channel

要嵌入一个没有 alpha 通道而只是黑色背景的视频,请在 <OffthreadVideo> 组件的 style 属性中添加 mixBlendMode: "screen"

🌐 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.

import React from 'react';
import {OffthreadVideo, staticFile} from 'remotion';

export const MyComp: 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