We want to install Raspbian on the Raspberry Pi. In an other computer download the
OS image available
here. This is a .zip package, to decompress execute in a linux console:
unzip [.zip folder address]
df -h
The /dev/sdb1 or /dev/sdb2 etc, is the SD image. You can see the available space (option -h), be carefull and choose the right unit.
Now copy the Raspbian image to the SD card:
sudo dd bs=4M if=[image address] of=/dev/sdbX
bs is the number of bytes written and read. The process take a while.
Next, put the SD card in the Raspberry Pi and plug it. The sistem start automatically. We recommend use the official
install notes. The Raspi configuration looks like this:
startx
sudo apt-get update
sudo apt-get upgrade
That take a long time, please be patient.
sudo apt-get install streamer ffmpeg mjpegtools vlc
Where streamer is a tool to record video and images from the console.
FFmpeg allows edit and record video with many options available in console.
MJPEG Tools are a set of tools that can do recording of videos and playback, simple cut-and-paste editing and the MPEG compression of audio and video under Linux. And
VLC is a open source media player only available with a desktop environment. Streamer and ffmpeg are capables to record video from a webcam, however streamer is light and does not consume too much system resources.
A important point is the webcam configuration, the camera used in this project is a generic model and we dont have any problem, but if you use another model please look this
page and read about the compatibility. In the web you can see a lot of tutorials to configure your camera on a Raspberry Pi. To check the correct operation of the camera and other peripheral type in the console:
lsusb
streamer -q -c /dev/video0 -f jpeg -s 480x360 -r 8 -t 00:00:05 -o out.avi
Where -c is the webcam reference, -f force the input or output video to a specific format, -s is the video size, -r means the number of frames per second, -t the video lenght and -o the name and format, in this case out.avi. Note that this line does not contain an audio option, since for this application we consider is optional.
ffmpeg -i "concat:input1.avi|input2.avi" -c copy output.avi
ffmpeg -i input.avi -vcodec copy -acodec copy -ss HH:MM:SS output.avi
In this section it is shown how to setup a FTP server for use in a local network.
Install vsftpd (Very Secure
FTP Daemon):
sudo apt-get install vsftpd
Create a new user, this will be the user that will login remotely to the
FTP server.
sudo adduser <ftpuser>
cd /etc
sudo cp vsftpd.conf vsftpd.conf.save
sudo nano vsftpd.conf
listen=YES
ftpd_banner=Welcome to my FTP server.
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=007
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
connect_from_port_20=YES
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/private/vsftpd.pem
Now the vsftpd configuration file should look like this:
A brief explanation of some of the parameters in the configuration file:
listen: If “listen” is set to YES, then vsftpd will run in standalone mode. This means that vsftpd doesn't have to be started manually.
ftpd_banner: Is the greeting banner displayed by vsftpd when a connection comes in.
anonymous_enable: Controls whether anonymous logins are permitted or not.
local_enable: Controls whether local logins are permitted or not.
local_umask: Is the umask set to the files created by local users.
chroot_local_user: If set to YES, local users will be (by default) placed in a chroot() jail in their home directory after login.
chroot_list_enable: If activated, you may provide a list of local users who are placed in a chroot() jail in their home directory upon login.
The next step is to login as the “ftpuser”, and apply an umask on the ftpuser home directory and to add your usual user to the ftpuser group:
su <ftpuser>
cd
umask 0007
exit
sudo adduser <myuser> <ftpuser>
su - <myuser>
The final step is to restart the
FTP daemon:
sudo /etc/init.d/vsftpd restart
After this, your personal FTP server is now ready to use.