Add image overlay on video FFmpeg

2019-03-20 16:04发布

I have a video, test.mp4, and an image, test.png.

test.png is a black image with a transparent "hole" in the center.

I would like, using FFmpeg:

  • To display test.png over the video so I can only see a circle of video
  • If possible, to resize test.png to the size of the video so it covers the whole thing

Is this possible ?

标签: video ffmpeg
2条回答
够拽才男人
2楼-- · 2019-03-20 16:24

Try this:

ffmpeg -i test.mp4 -framerate 30000/1001 -loop 1 -i test.png -filter_complex "[1:v] fade=out:st=30:d=1:alpha=1 [ov]; [0:v][ov] overlay=10:10 [v]" -map "[v]" -map 0:a -c:v libx264 -c:a copy -shortest out.mp4
查看更多
小情绪 Triste *
3楼-- · 2019-03-20 16:34

I used this on android and its working fine :-

String[] cmd = new String[]{ "-i", video.mp4, "-i", image.png, "-filter_complex", "overlay=0:main_h-overlay_h", outputFile.getPath()};
查看更多
登录 后发表回答