LoginSignup
0
1

More than 5 years have passed since last update.

Raspberry Pi Cameraで日付+時間をファイル名にして保存

Last updated at Posted at 2017-01-05

準備

ImageMagickのインストール
この中のconvertを使ってサムネイル用のファイルを作る。

sudo apt-get install imagemagick

だと、”いくつかのアーカイブを取得できません。・・・・”というメッセージが最後に表示され失敗。
なので、

sudo apt-get -f install imagemagick

で目的のコマンドがインストール出来た。

あらあらのフロー

日付+時間.jpgを変数に代入→raspistillで撮影→convertで縮小してサムネイル保存

シェルスクリプト

で、出来たスクリプトがこれ。
kasha.sh

NOW_TIME=`date '+%Y%m%d-%H%M'`.jpg

raspistill -o $NOW_TIME

convert -resize 320x -quality 100 $NOW_TIME thumb$NOW_TIME
0
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
0
1