2
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.

JPEG画像からwebm動画を生成する。

Last updated at Posted at 2022-01-15

1. この記事は

Raspberry Pi上でにて静止画(jpegファイル)から動画ファイル(webm)を作成する方法を説明します。

2. 方法

Raspberry Pi上にffmpegがインストールされているものとします。

example
ffmpeg -loop 1 -y -i n225.jpg -vcodec libvpx -pix_fmt yuv420p -t 1 -r 1 n225.webm

構文
-loop 1 -i n225.jpg
-loop 1のところでn225.jpgという入力を延々とループすることを意味します。また、-iオプションで入力画像の名前を設定します。

-y
同名の出力ファイルがあった場合上書きする。

vcodec libvpx
動画の出力形式を指定する。

-t 1
-tオプションで出力する動画の時間を示します。3を設定しているので3秒の動画になります。

-r 1
-rオプションでfpsを示します。1なので1fpsの動画で出力されます。

n225.webm
出力ファイル名(webm形式)


N225_01.png,N225_02.png,N225_03.png,N225_04.png の4枚について、1枚1秒表示させる動画を作成する。(動画の長さは4秒になる)

webm形式の場合

example
 ffmpeg -y -r 1 -i N225_%02d.png -vcodec libvpx -pix_fmt yuv420p  -crf 18 -t 4  test.webm

mp4形式の場合(mp4形式のほうがwebmよりも動画はきれい)

example
ffmpeg -y -r 1 -i myslide_%02d.jpg -vcodec libx264 -pix_fmt yuv420p  -crf 18 -t 4  myslide.mp4
2
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
2
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?