我的视频blog地址 http://www.lofter.com/blog/cloudrivers

树莓派摄像头操作命令及流程

第一步:开启摄像头模式

在终端输入  sudo raspi-config  

选择  Enable canmer

然后finish

然后方向键右右然后回车  退出config

第二步:拍照片测试

终端输入 raspistill -o testcapture.jpg 

摄像头红灯开始闪烁,屏幕有五秒预览画面,第五秒的图像进行拍照

附带的调整图像命令是

raspistill -otestcapture.jpg -vf   使图像上下颠倒

raspistill -otestcapture.jpg -hf   使图像左右颠倒

-o将图像输出到了名为tescapture的JPEG文件中   还可以用如下命令改变调整格式

 Raspistill -o testcapture.png -e png    (改变为PNG格式)

 Raspistill -o testcapture.bmp -e bmp   (改变为BMP格式)

 Raspistill -o testcapture.gif -e gif     (改变为GIF格式)

调整图像长宽的命令如下:、

 Raspistill -w 1920 -h 1080 -ofullhdcapture.jpg

-w   宽度    -h   长度

控制预览的延时命令如下:

 raspistill-t 10000 -o tensecondcapture.jpg    (单位为毫秒)

 raspistill-t 1 -o instancapture.jpg    (秒拍)

此处缺少知道照片所存储的位置以及如何读取

 

录制视频

第一步:检查摄像头可用与否

Raspivid -o testvideo.h246    格式只能是H.246   

调整窗口大小 raspivid -w 1280 -h 720 -ofullhvideo.h246

调整录制时间 raspivid -t 60000 -ominutelongvideo.h246

第二步:使用shell脚本编写定时控制

Mkdir timeplace            #创建文件

Cd timeplace               #进入文件

Nano timeplace.sh          #打开脚本,进入编辑

 

输入如下:

#!bin/bash                       #注释使用默认的bash 的shell

#capture time-lapse images using raspistillapplication    #避免我们不知道自己在干嘛

While true

Do

    Flamename=’data+%Y%M%D%H%M%S’.jpg      #调用data   形成文件格式名称

Raspistill -w 1920 -h 1080 -t 1 -o$filename         #拍照

Echo Image captured                           #向控制台或终端输出打印信息

Sleep 30  #单位  秒

Done      #关闭循环

 

 

第三步:修改文件权限

Chmod +xtimeplace.sh

第四步:执行命令

./timeplace.sh

第一步:开启摄像头模式

在终端输入  sudo raspi-config  

选择  Enable canmer

然后finish

然后方向键右右然后回车  退出config

第二步:拍照片测试

终端输入 raspistill -o testcapture.jpg 

摄像头红灯开始闪烁,屏幕有五秒预览画面,第五秒的图像进行拍照

附带的调整图像命令是

raspistill -otestcapture.jpg -vf   使图像上下颠倒

raspistill -otestcapture.jpg -hf   使图像左右颠倒

-o将图像输出到了名为tescapture的JPEG文件中   还可以用如下命令改变调整格式

 Raspistill -o testcapture.png -e png    (改变为PNG格式)

 Raspistill -o testcapture.bmp -e bmp   (改变为BMP格式)

 Raspistill -o testcapture.gif -e gif     (改变为GIF格式)

调整图像长宽的命令如下:、

 Raspistill -w 1920 -h 1080 -ofullhdcapture.jpg

-w   宽度    -h   长度

控制预览的延时命令如下:

 raspistill-t 10000 -o tensecondcapture.jpg    (单位为毫秒)

 raspistill-t 1 -o instancapture.jpg    (秒拍)

此处缺少知道照片所存储的位置以及如何读取

 

录制视频

第一步:检查摄像头可用与否

Raspivid -o testvideo.h246    格式只能是H.246   

调整窗口大小 raspivid -w 1280 -h 720 -ofullhvideo.h246

调整录制时间 raspivid -t 60000 -ominutelongvideo.h246

第二步:使用shell脚本编写定时控制

Mkdir timeplace            #创建文件

Cd timeplace               #进入文件

Nano timeplace.sh          #打开脚本,进入编辑

 

输入如下:

#!bin/bash                       #注释使用默认的bash 的shell

#capture time-lapse images using raspistillapplication    #避免我们不知道自己在干嘛

While true

Do

    Flamename=’data+%Y%M%D%H%M%S’.jpg      #调用data   形成文件格式名称

Raspistill -w 1920 -h 1080 -t 1 -o$filename         #拍照

Echo Image captured                           #向控制台或终端输出打印信息

Sleep 30  #单位  秒

Done      #关闭循环

 

 

第三步:修改文件权限

Chmod +xtimeplace.sh

第四步:执行命令

./timeplace.sh
————————————————
版权声明:本文为CSDN博主「qq_39705572」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_39705572/article/details/80800254

posted @ 2019-09-07 19:18  Michael云擎  阅读(5485)  评论(0编辑  收藏  举报
我的视频blog地址 http://www.lofter.com/blog/cloudrivers