LoginSignup
2
0

More than 5 years have passed since last update.

ffmpegで録画&静止画化

Posted at

カメラ設定

v4l2-ctl -c exposure_auto=3 #自動露出
v4l2-ctl --set-fmt-video=width=1280,height=720,pixelformat=1
v4l2-ctl -p 30 #フレームレート

取り込み。-t で録画時間設定。-c copyで無変換で高速に録画できる。そうしないとfpsが下がる。

ffmpeg -y -f v4l2 -input_format mjpeg -i /dev/video0 -c copy -t 10.5 /tmp/1.mkv

静止画化。-r 2 で2秒ごとに1つの静止画化。-ss で最初のデータを読み飛ばさないとだめぽい。

ffmpeg -ss 1 -i /tmp/1.mkv -r 2 -f image2 /tmp/a%06d.jpg

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