Table of Contents

Implementation

Here are the instructions to implement the necesary packages to run a Raspberry Pi as a portable video camera and to setup a FTP server in a local network in order to transfer the video files from the Raspberry Pi to a computer via Internet.

Configuring the Raspberry Pi

unzip [.zip folder address]
df -h
sudo dd bs=4M if=[image address] of=/dev/sdbX 

bs is the number of bytes written and read. The process take a while.

startx
sudo apt-get update
sudo apt-get upgrade

That take a long time, please be patient.

Recording video

sudo apt-get install streamer ffmpeg mjpegtools vlc
lsusb

streamer -q -c /dev/video0 -f jpeg -s 480x360 -r 8 -t 00:00:05 -o out.avi
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

Setting up the FTP server

In this section it is shown how to setup a FTP server for use in a local network.

sudo apt-get install vsftpd
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:

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>
sudo /etc/init.d/vsftpd restart

After this, your personal FTP server is now ready to use.

Accessing the FTP server

sudo apt-get install ftp
ftp 192.168.XXX.XXX

Some commands in the ftp client command line:

Back to index

Previous section

Next section