场景
不带透明通道的视频,除非是那种图标或者其他小的标志图片,如果想将整个视频覆盖到原视频上,且使黑色像素透明的话,直接overlay就不可以了,会把底层的视频整个覆盖掉;
解决方法一
此时我们要用到:
alphamerge【https://ffmpeg.org/ffmpeg-filters.html#alphamerge】
Add or replace the alpha component of the primary input with the grayscale value of a second input. This is intended for use with alphaextract to allow the transmission or storage of frame sequences that have alpha in a format that doesn’t support an alpha channel.
用第二个输入的灰度值添加或替换主要输入的alpha分量。 旨在与alphaextract一起使用,以允许传输或存储具有alpha格式但不支持alpha通道的帧序列。
For example, to reconstruct full frames from a normal YUV-encoded video and a separate video created with alphaextract, you might use:
例如,要从普通的YUV编码视频和使用alphaextract创建的单独视频中重建完整帧,可以使用: