3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

ffmpegで動画を無音(+別の音源を加える)して、logoも付与する際の備忘録

Last updated at Posted at 2022-09-17

ffmpegで動画を無音(+別の音源を加える)して、ロゴを付与する際の備忘録

無音化

サウンド付きの動画を無音化する。
-an disable audio

ffmpeg -i input.mp4 -an output.mp4

2つの音声ファイル(file1,file2)を結合する

ffmpeg -i file1.mp4 -i file2.mp4 -filter_complex 'concat=n=2:v=0:a=1' file3.mp3

ffmpegを使って映像と音声を結合して一つの動画ファイルにする

ffmpeg -i video.mp4 -i audio.wav -c:v copy -c:a aac -map 0:v:0 -map 1:a:0 output.mp4

音声を結合した場合は、動画の尺が長くなるかもしれないので以下を参考に尺を意図通りの長さにする。
https://nico-lab.net/cutting_ffmpeg/

ロゴを付与する

ポイントは「logo.png -filter_complex overlay=10:10」の部分で、まずは重ねたい画像を「logo.png」のところに指定した上で、Overlayフィルタというものを使ってロゴを動画に重ねます。
「overlay=10:10」は、重ねる位置を示していて、動画の左上の座標を(0,0)としたときに、右下に向かって(10,10)の位置にロゴが重なります。

ffmpeg -i input.mp4 -i logo.png -filter_complex overlay=10:10 output1.mp4

例えば、添付のchallenge_club.pngのような画像を重ねたい場合は以下のようにすればOK

ffmpeg -i input.mp4 -i challenge_club.png -filter_complex overlay=1350:00 output4.mp4

challenge_club.png
challenge_club.png

結合する場合はこちらを参照
(ubuntuだと意図通り結合できず、macだと意図通り結合できることがあった。謎。。)

参考

3
1
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
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?