高动态范围和消除
高动态范围(HDR)是一种功能,它允许比标准动态范围(SDR)更广的颜色和亮度范围。
🌐 High Dynamic Range (HDR) is a feature that allows for a wider range of colors and brightnesses than standard dynamic range (SDR).
Remotion 使用无头 Chrome 浏览器进行渲染,该浏览器不支持 HDR。
帧始终以 sRGB 渲染,这是标准动态范围。
🌐 Remotion uses a headless Chrome browser to render, which does not support HDR.
Frames are always rendered in sRGB, which is standard dynamic range.
嵌入HDR视频
🌐 Embedding HDR videos
如果在你的合成中嵌入了 HDR 视频,它必须转换为 SDR。这是一个本质上有损的过程,轻微的颜色损失是不可避免的。
🌐 If a HDR video is embedded in your composition, it must be converted to SDR. This is a process which is inherently lossy and a slight color lost is unavoidable.
在 <Video /> 和 <Html5Video /> 中
🌐 In <Video /> and <Html5Video />
在 <Video /> 和 <Html5Video /> 中,颜色转换由浏览器处理。
然而,--gl 标志是相关的,可能会影响颜色。
🌐 In <Video /> and <Html5Video />, color conversion is handled by the browser.
However, the --gl flag is relevant and may influence the colors.
提示:设置 --gl=angle 在嵌入 HDR 视频时会得到更好的颜色效果(已在 macOS 测试)。
我们尚未足够试验,以对使用哪个 --gl 标志提出建议。
Remotion 团队很想听听你的使用体验。
🌐 Tip: Setting the --gl=angle will result in much better colors when embedding an HDR video (tested on macOS).
We have not yet experimented with this enough to give a recommendation on which --gl flag to use.
The Remotion team is keen to hear your experiences.
在 <OffthreadVideo />
🌐 In <OffthreadVideo />
默认情况下,颜色转换会自动应用于 HDR 视频。
在将视频转换为 SDR 时,Remotion 会尝试使用 FFmpeg 和 zscale 库尽可能保留颜色。
🌐 By default, color conversion is applied automatically to HDR videos.
Remotion tries to use FFmpeg and the zscale library to preserve the colors as well as possible when converting the video to SDR.
没有配置,但可以禁用此功能:
🌐 There is no configuration, but it is possible to disable this feature:
Disabling color conversionimport {OffthreadVideo } from 'remotion'; export constMyComp = () => { return <OffthreadVideo src ="https://example.com/hdr.mp4"toneMapped ={false} />; };
输出 HDR 视频
🌐 Outputting HDR videos
因为所有帧都是以 SDR 渲染的,使用 Remotion 输出 HDR 视频是没有意义的。
🌐 Because all frames are rendered in SDR, it doesn't make sense to output an HDR video with Remotion.
最好接受损失并输出 SDR 视频,而不是尝试将帧重新转换为 HDR,这样会导致更多损失。
🌐 It is better to accept the loss and output an SDR video, rather than trying to convert the frames to HDR again, which would lead to more loss.
话虽如此,有一个选项 --color-space 可以设置为 bt2020-ncl 或 bt2020-cl 来输出 HDR 视频。
这是一个错误,不推荐使用。
该选项会导致视频被标记为 HDR,但视频内容实际上并不是 HDR。你会发现画面过于明亮且曝光过度。
🌐 That being said, there is an option --color-space which can be set to bt2020-ncl or bt2020-cl to output an HDR video.
This was a mistake and is not recommended.
This option will lead to the video being tagged as being HDR, but the content inside the video is not actually HDR. You will experience the picture to be overly bright and overexposed.