First, we connect the camera to the intended CSI interface (pictured above) and start the configuration tool of the Raspberry Pi.
pi @ raspberrypi ~ $ sudo Raspi-config
Further down the line "Enable Camera" should be visible. If simply press Enter, save, and the Raspberry Pi with "sudo reboot" Yes, restart the computer. If the line is missing, the system must be brought up to date with the following two commands:
pi @ raspberrypi ~ $ sudo apt-get update
pi @ raspberrypi ~ $ sudo apt-get upgrade
pi @ raspberrypi ~ $ sudo apt-get upgrade

Take pictures
Shot in Jpeg format
pi @ raspberrypi ~ $ raspistill -o image.jpg
Shot in PNG format
The -e option you can create the file types jpg, bmp, gif and png.
pi @ raspberrypi ~ $ raspistill -o -e image.png png
Without receiving Preview
pi @ raspberrypi ~ $ raspistill -o -n image.jpg
Recording on left and right keys (Enter)
Is replaced by image image.jpg% 02d.jpg a new file in the format image01.jpg is created each left and right keys.
pi @ raspberrypi ~ $ raspistill -t 0 -k -o image.jpg
Delayed Up (3 seconds)
pi @ raspberrypi ~ $ raspistill -o -t image.jpg 3000
Shot in a lower resolution (640x480)
pi @ raspberrypi ~ $ raspistill -o -w 640 -h 480 image.jpg
Shot in a lower quality
The reduction of quality saves disk space. Valid values are from 0 to 100 possible.
pi @ raspberrypi ~ $ raspistill -o image.jpg -q 20
Time-lapse recording
Use the following command to one hour (-t 3600000) every 5 seconds (-tl 5000) added a picture. The name% 04d is the file name for a four-digit numbering (eg image_0001.jpg).
pi @ raspberrypi ~ $ raspistill -o -t image_% 04d.jpg -tl 5000 3600000
The images created can be converted into an mp4 video file with the tool ffmpeg.
pi @ raspberrypi ~ $ ffmpeg -r 5 -qscale 4 -b -i 9600 IMG_% 04d.jpg zeitraffer.mp4
Record videos
5 second video in 1080p (1920 x 1080)
The option -t gives you the recording time in milliseconds. For an infinite recording (eg for a stream) simply set the value to 0.
pi @ raspberrypi ~ $ raspivid -o -t video.h264 50000
5 second video in 720p (1280 x 720)
pi @ raspberrypi ~ $ raspivid -o video.h264 -t -w 1280 -h 720 50000
With individual video bitrate (3.5MBits / s)
pi @ raspberrypi ~ $ raspivid -o video.h264 -t -b 50000 3500000
With individual video frame rate (10 frames / second)
pi @ raspberrypi ~ $ raspivid -o video.h264 -t -f 50000 10
Send video stream to stdout
pi @ raspberrypi ~ $ 50000 raspivid -t -o -
Convert videos
H264 mp4 by
pi @ raspberrypi ~ $ sudo apt-get install gpac
pi @ raspberrypi ~ $ MP4Box -add -fps 30 video.h264 video.mp4
pi @ raspberrypi ~ $ MP4Box -add -fps 30 video.h264 video.mp4
LED on / off
1. Method
Add the following line to the file "/boot/config.txt" to and do a reboot. Unfortunately, it can happen that the settings are lost after a reboot.This is related to Kompatibilitätsroblemen some SD cards. If this is the case, edit the file to a different Linux box and use the second method.
disable_camera_led = 1
2. Method
Once deactivated by the above method, the LED on the GPIO 5 can be controlled.
pi @ raspberrypi ~ $ sudo echo "5"> / sys / class / gpio / export
pi @ raspberrypi ~ $ echo "out"> / sys / class / gpio / gpio5 / direction
pi @ raspberrypi ~ $ echo "1"> / sys / class / gpio / gpio5 / value
pi @ raspberrypi ~ $ echo "out"> / sys / class / gpio / gpio5 / direction
pi @ raspberrypi ~ $ echo "1"> / sys / class / gpio / gpio5 / value
Stream on other Raspberry Pi computer or
Preparing the server
Use the tool Netcat can send the stream generated by raspivid directly to another computer or Raspberry Pi. Therefore one must only know of the receiver (client) IP address. This one shows under Unix with ifconfig and Windows computers with ipconfig.
Example In the following the stream to another Raspberry Pi with the IP address 192.168.178.20 is sent to port 5001:
pi @ raspberrypi ~ $ sudo apt-get install netcat
pi @ raspberrypi ~ $ raspivid -t 0 -o - | nc 192.168.178.20 5001
pi @ raspberrypi ~ $ raspivid -t 0 -o - | nc 192.168.178.20 5001
Preparing the Client - Linux
The Raspberry Pi / Linux client of the video player MPlayer in addition to netcat installed later to the stream directly displayed on the graphical interface.
pi @ raspberrypi ~ $ sudo apt-get install mplayer netcat
pi @ nc -l -p raspberrypi ~ $ 5001 | mplayer -fps 31 -cache 1024 -
pi @ nc -l -p raspberrypi ~ $ 5001 | mplayer -fps 31 -cache 1024 -
Preparation of the client - Windows
If not already have the tools


The stream is started with the following command in the command prompt.
[Path to nc.exe] nc.exe -L -p 5001 | [path to mplayer.exe] mplayer.exe -fps 31 -cache 1024 -
No comments:
Post a Comment