1
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 5 years have passed since last update.

raspberry pi4 の初期設定 (pi 無効化、ssh 認証変更、IP固定化) とカメラ回り(raspivid、ffmpeg)

Last updated at Posted at 2019-12-14

ただの忘備録です。マウスとキーボード無しで画面を出してカメラのテストをする場合は、自動ログインにしておくこと。

pi3 からの変更点

  • 重要: HDMI コネクタが Mico になった。
  • 重要: 電源コネクタが USB-C になった。

pi アップデート

sudo apt update
sudo apt upgrade -y
sudo shutdown -r now

pi アカウント無効化

アカウント名を変更して対処
https://qiita.com/kenchang/items/849c82f16ba5eafe070d

削除して追加
https://makezine.jp/blog/2017/09/secure-your-raspberry-pi-against-attackers.html

IP固定化

SSH認証変更(鍵認証)

pi カメラ v2 を使う

カメラ生存確認

vcgencmd get_cammera

静止画撮影

raspistill -o hoge.png

動画撮影

raspivid -o hoge.h264 -t 10000 -fps 30
raspivid -o hoge.h264 -w 1920 -h 1080 -t 10000 -p '100,100,1920,1080' -fps 30

再生

omxplayer hoge.h264

h264 で録画すると fps は何を指定しても見掛け上は 25fps になる。25fps でない動画をそのまま vlc media player などで再生すると fps が 25 で再生されるため、正常な表示にならない。正常に表示させるためには、ffmpeg などで -vf fps=30 などと指定してやってから、fps のデータが有効な mp4 などのフォーマットに変換する必要がある。

変換方法は https://qiita.com/kitar/items/59f80bba2ca997e0f5e6 より。

ffmpeg -i hoge.h264 -movflags faststart -vcodec libx264 -acodec libfaac -vf fps=30 hoge.mp4
1
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
1
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?