LoginSignup
14
9

More than 5 years have passed since last update.

1秒の無音の音楽ファイル作成・1秒の動画を1枚の静止画から作成

Posted at

1秒の無音の音楽ファイルを生成

ffmpeg -ar 48000 -t 00:00:01 -f s16le -acodec pcm_s16le -ac 2 -i /dev/zero -acodec libmp3lame -aq 4 silent.mp3

です。

-t xx:xx:xx -f 

の部分が秒数指定です

silent.mp3のファイル名は任意で

1秒の動画を1枚の静止画から作成

ffmpeg -loop 1 -i image.png  -i ~/silent.mp3 -c:v h264 -c:a mp2 -t 00:00:01 -vf scale=640:640 -y -pix_fmt yuv420p -r 29.98 movie.mp4

image.png: 動画にしたい静止画
silent.mp3: BGMにしたい音楽ファイル(今回はさっき作った無音mp3)
movie.mp4: 生成する動画のファイル名
00:00:01: 動画の秒数

14
9
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
14
9