0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ffmpeg で映像に映像を重ねる (overlay フィルタ)

Posted at

何番煎じかもわかりませんが、備忘録として。

やりたいこと

以下のような映像 (A.mp4 とする) と、

image.png

以下のような映像 (B.mp4 とする) があったとして、

image.png

それらをこのように重ねた動画を作りたい。

overlay-result.gif

ffmpeg の overlay ビデオフィルタで、例えばこんな感じ。

ffmpeg -i A.mp4 -i B.mp4 -filter_complex "overlay=0:374" out.mp4

オプション最小量、つまりデフォルトオプションの場合、先に指定された -i (ここでは A.mp4) の上に、後で指定された -i (ここでは B.mp4) を重ねる。

overlay=X:Y で、重ねる映像の左上位置を調整する。主な要点は以上。

ちなみに [1][0]overlay=... と数字を入れると、B.mp4 の上に A.mp4 を重ねるようになる。3つ以上の映像を重ねるといったことも可能だが、ある程度の規模になってきたら、たぶん動画編集ソフト使った方がスムーズ。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?