-
Notifications
You must be signed in to change notification settings - Fork 1
Record and Retrieve Videos
Home
Previous: Install Video Recording Scripts
Once a Raspberry Pi has been programmed with the scripts in this repository, recording videos over an SSH connection is a simple process. Retrieving videos is also easy, and there are many different methods to do so.
Recording videos remotely requires:
- Raspberry Pi with installed video recording scripts
- either a Wi-Fi router or Ethernet cable
- PC, with either Wi-Fi or Ethernet capabilities
Retrieving videos may also require a flash drive, depending on the retrieval method.
- Connect to the Pi via SSH (with either Termius (easy SSH connection) or the
ssh
command (basic setup)).* - Run a custom recording command by entering its name.
- If a custom recording command has been set to run upon SSH connection, users can skip this step. If a user wants to run a command other than the one set to run upon SSH connection, they can cancel it by pressing
ctrl + c
and then run the desired command by entering its name. - All commands can be listed by entering
sh RasPi-filming-code/listcommands.sh
.
- If a custom recording command has been set to run upon SSH connection, users can skip this step. If a user wants to run a command other than the one set to run upon SSH connection, they can cancel it by pressing
- For
Subject:
, enter a recognizable name for the video file. These scripts were originally created for filming behavioral subjects, hence the prompt "Subject". - For
Start? (Y/n)
, when ready, pressenter
to start recording. Entern
instead to cancel the recording script. - Leave the SSH connection open until recording has finished and the script has output
Recording Complete
.
* - Note, a custom recording command can also be run locally from the Pi if a keyboard and monitor are connected. Just open Terminal on the Pi and run the command as described in steps 2-5 above.
There are several ways to transfer videos from the Pi to another device, some via physical connections, others via remote connections. Physical connections transfer videos faster, and are more recommended for very large video files. Remote connections can be more convenient, especially if the IP address of the Pi is known.
- Connect the flash drive to the Pi
- Connect to the Pi via SSH (with either Termius (easy SSH connection) or the
ssh
command (basic setup)). - Enter
ls /media/<Pi username>
to display the ID of the connected flash drive. - Enter
ls recordings
, to display all video recordings currently stored on the Pi. - Enter
cp -r recordings /media/<Pi username>/<drive ID>/.
to copy therecordings
directory to the flash drive.- This may take a while when copying many files or large files.
- Enter
ls /media/<Pi username>/<drive ID>/recordings
to verify that all of the video recordings have been copied to the flash drive. - Unplug the flash drive to disconnect it.
- Optionally, enter
rm recordings/*
in the SSH terminal to delete all of the video recordings from the Pi.
- On a PC, either connect to the same Wi-Fi network as the Pi or connect to the Pi directly via an Ethernet cable.
- Open a terminal (Command Prompt on Windows, Terminal on macOS and Linux) and navigate to a directory which the video recordings can be copied to.
- Enter
scp -r <Pi username>@<Pi IP address>:~/recordings .
and enter the Pi password when prompted.- This may take a while when copying many file or large files.
- Enter
ls recordings
to verify that all of the video recordings have been copied to the PC. - Optionally, the video recordings can later be deleted from the Pi by connecting via SSH and entering
rm recordings/*
.
- Connect to the Pi via SSH (with either Termius (easy SSH connection) or the
ssh
command (basic setup)). - Enter
python RasPi-filming-code/simpleServer.py
to begin hosting a server from the Pi. Keep the SSH connection open until all desired video files have been copied. - On a PC or mobile device connected either to the same Wi-Fi network as the Pi or connected directly to the Pi via an Ethernet cable, open a web browser and enter
<Pi IP address>:8000
into the address bar. This should display the files and directories contained in the home directory of the Pi as clickable links. - Select the
recordings
link to navigate into the directory where the video recordings are stored. - Select the link of a file to begin downloading it from the Pi.
- After downloading all desired files, check the
Downloads
directory of the connecting device to ensure the video files have all been copied to the connected device. - In the SSH terminal, press
ctrl + c
to shut down the server on the Pi. - Optionally, enter
rm recordings/*
in the SSH terminal to delete all of the video recordings from the Pi.