将透明影片合并至其他影片时,会显示黑色叠加层 [英] Black overlay appears when merging a transparent video to another video

查看:271
本文介绍了将透明影片合并至其他影片时,会显示黑色叠加层的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我迄今为止所做的:

This is what I have done so far:

创建透明PNG图像的命令:

convert -size 640x480 -background transparent -fill blue \
-gravity South label:ROCK image1-0.png

创建透明视频的命令

ffmpeg -loop 1 -f image2 -i image1-0.png -r 20 -vframes 100 \
-vcodec png -pix_fmt bgra mov-1.mov

(根据这篇文章) - 我希望这个视频是一个透明视频

(as per this post) - I expect this video to be a transparent video.

将视频与其他视频重叠的命令:

ffmpeg -i final-video.mov -sameq -ar 44100 \
-vf "movie=mov-1.mov [logo];[in][logo] overlay=0:0 [out]" \
-strict experimental final-video.mov

A bove命令工作完美,我没有遇到任何问题,但我没有得到我期望的是一个水印效果,我想要mov-1.mov是透明的final-video.mov。

Above commands works perfect and I have not faced any problem, but I don't get what I expect which is kinda watermarking effect, I want mov-1.mov to be transparent with final-video.mov.

问题:


  1. 有没有办法验证生成的视频是透明的吗?除了合并?

  2. 不知道为什么上面的mov-1.mov与final-video.mov合并时不透明,任何解决这个问题的信息都会很好。 / li>
  1. Is there any way to verify if the generated video is transparent? other than merging?
  2. Not sure why the above mov-1.mov is not transparent when it is merged with final-video.mov, any info to solve this problem would be great.

请帮忙。

推荐答案

ImageMagick并不总是以FFmpeg理解的方式产生透明的png。 >这个答案我看到,我 显然能够使ImageMagick以FFmpeg喜欢的方式产生透明度,方法是设置 png:color-type 。您的转换命令将成为:

ImageMagick doesn't always produce transparent pngs in a way that FFmpeg understands. I was reduced to using GIMP to create indexed transparent images the last time I faced this problem. Nevermind, looking back at this answer I see that I was apparently able to make ImageMagick produce transparency in a way that FFmpeg liked by setting png:color-type. Your convert command would become:

convert -size 640x480 -background transparent -fill blue \
-gravity South label:ROCK -define png:color-type=6 image1-0.png

不需要将图像转换成自己的电影。 电影视频过滤器将接受透明png作为输入。

That said, you don't need the turn the image into its own movie. The movie video filter will accept a transparent png as input.

这篇关于将透明影片合并至其他影片时,会显示黑色叠加层的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆