Skip to content
andreasloe edited this page Jun 5, 2019 · 1 revision

Read the Help web page in the System panel, the configuration files in ~/.pikrellcam and the files in the scripts directory to get an idea of what can be configured.

Configuration files

The following files cover the configuration of PiKrellCam.

  • pikrellcam.conf - edit this file to set motion event commands, filename templates, and directories. Many other configuration variables in this file can be set from the web interface. If you edit this file, you should stop pikrellcam and restart it to pick up the changes.
  • at-commands.conf - edit this file to set scheduled commands at a particular time and frequency. If you edit this file, it will be automatically reloaded into pikrellcam and you do not need to restart.
  • motion-regions.conf - it's difficult to hand edit this file. Just graphically adjust your motion regions through the web interface and save. You can save name qualified region configurations which will be named motion-regions-name.conf. The special name "default" references the default file motion-regions.conf.

Configuration Notes:

While the www directory itself is fixed, the media directory can be relocated from its /home/pi/pikrellcam/media default to something like /home/pi/media, /mnt/media or even /tmp/media which with /tmp as a tmpfs can be a useful SD card saving special case configuration as long as the limited space is managed. For this, edit media_dir in pikrellcam.conf, restart and the web page link to the new media directory will be automatically updated.

  • If you have a flash drive plugged in that you want automatically mounted on the media directory for storing videos, stills and timelapse, edit scripts/startup and set the MOUNT_DISK variable. The mounting will automatically track the media_dir in pikrellcam.conf should you change it. If media_dir is in a tmpfs, it will not be mounted.
  • If you want motion detect videos archived to another machine, you can setup a NFS mount on the Pi running Pikrellcam so that clicking the NFS Archive button on the Videos page will save the video on a NFS mounted machine.
  • In the ~/.pikrellcam/at-commands.conf file add any commands to run at a desired time and frequency. You can set up a scheduled timelapse run with hold times, motion detect on/off times or complex video record times with interleaved pause/run intervals. There is no limit to the number of at commands and at commands can be any pikrellcam script you write, a FIFO command, or any Pi system command.
  • Edit ~/.pikrellcam/pikrellcam.conf and enable the on_motion_preview_save command with your email address and pikrellcam will email you a jpg of each motion detect event.
  • The on_timelapse_end command in pikrellcam.conf is pre-configured to run the default timelapse-end script in the scripts directory. This script uses avconv to convert timelapse jpegs into a mp4 which is saved into the videos directory and then the individual timelapse files are deleted. If you want to do something different like copy timelapse files to a more powerful machine for conversion or not delete the timelapse jpegs, you will have to modify the setup.
    With the default setup on a Pi 2, avconv converts 100 timelapse jpegs into about a 17 second 12 MByte video in about 4 minutes. Toggle show timelapse on the OSD to monitor the converted MP4 size progress. A B+ with one core can be 12 times slower.
Clone this wiki locally