Skip to content

Commit

Permalink
Audio/video recording. Help page has audio docs.
Browse files Browse the repository at this point in the history
Version 4.0: add audio recording to videos and audio streaming to a browser.
  • Loading branch information
billw2 committed Apr 11, 2017
1 parent 611df03 commit c9f162d
Show file tree
Hide file tree
Showing 32 changed files with 1,879 additions and 243 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
scripts
www/.htpasswd
www/FIFO
www/audio_FIFO
www/media
www/config-user*
www/images/bg_*
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# PiKrellCam

PiKrellCam is a video recording motion detect program with an OSD
web interface that detects motion using the Raspberry Pi camera
MMAL motion vectors.
PiKrellCam is an audio/video recording motion detect program with an OSD web
interface that detects motion using the Raspberry Pi camera MMAL motion vectors.

Read about it and install instructions at:
[PiKrellCam webpage](http://billw2.github.io/pikrellcam/pikrellcam.html)
Expand Down
8 changes: 5 additions & 3 deletions install-pikrellcam.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ echo "Starting PiKrellCam install..."
# =============== apt install needed packages ===============
#
PACKAGE_LIST=""
for PACKAGE in gpac php5 php5-common php5-fpm nginx libav-tools bc sshpass mpack imagemagick apache2-utils
for PACKAGE in gpac php5 php5-common php5-fpm nginx libav-tools bc \
sshpass mpack imagemagick apache2-utils libasound2 libasound2-dev \
libmp3lame0 libmp3lame-dev
do
if ! dpkg -s $PACKAGE 2>/dev/null | grep Status | grep -q installed
then
Expand All @@ -124,7 +126,7 @@ then
echo "Installing packages: $PACKAGE_LIST"
echo "Running: apt-get update"
sudo apt-get update
sudo apt-get install -y $PACKAGE_LIST
sudo apt-get install -y --no-install-recommends $PACKAGE_LIST
else
echo "No packages need to be installed."
fi
Expand All @@ -140,7 +142,7 @@ then
if ! dpkg -s realpath 2>/dev/null | grep Status | grep -q installed
then
echo "Installing package: realpath"
sudo apt-get install -y realpath
sudo apt-get install -y --no-install-recommends realpath
fi
fi

Expand Down
Binary file modified pikrellcam
Binary file not shown.
8 changes: 8 additions & 0 deletions scripts-dist/_upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,12 @@ else
fi
fi

MESSAGE=`$INSTALL_DIR/scripts-dist/_upgrade-message`
len=${#MESSAGE}
if (( len > 0 ))
then
echo "inform \"$MESSAGE\" 8 4 1" > $FIFO
TIMEOUT=20
fi

echo "inform timeout $TIMEOUT" > $FIFO
8 changes: 8 additions & 0 deletions scripts-dist/_upgrade-message
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

if ! dpkg -s libmp3lame0 2>/dev/null | grep Status | grep -q installed
then
echo "WARNING: install libmp3lme0 or restart will fail!"
fi

exit 0
9 changes: 6 additions & 3 deletions scripts-dist/preview-save
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@ THUMB_JPEG=$5
# OR, to email the smaller motion area thumb jpg, uncomment this line:
# EMAIL_JPEG=$THUMB_JPEG

# Edit MY_EMAIL to your email address to email the preview jpeg.
# Edit MY_EMAIL to your email address to email the preview jpeg and uncomment
# the mpack line. Run mpack in the background because if it is slow in
# sending the email, pikrellcam is waiting for this script to end and the
# preview display can pause.
#
MY_EMAIL=myuser@gmail.com
#mpack -s pikrellcam@$HOSTNAME $EMAIL_JPEG $MY_EMAIL
#mpack -s pikrellcam@$HOSTNAME $EMAIL_JPEG $MY_EMAIL &

#echo "mpack -s pikrellcam@$HOSTNAME $PREVIEW_JPEG $MY_EMAIL" >> $LOG_FILE
#echo "mpack -s pikrellcam@$HOSTNAME $PREVIEW_JPEG $MY_EMAIL &" >> $LOG_FILE



Expand Down
7 changes: 4 additions & 3 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ MMAL_LIB ?= -L/opt/vc/lib -lbcm_host -lvcos -lmmal -lmmal_core -lmmal_util \


FLAGS = -O2 -Wall $(MMAL_INCLUDE) $(INCLUDES)
LIBS = $(MMAL_LIB) -lm -lpthread
LIBS = $(MMAL_LIB) -lm -lpthread -lasound -lmp3lame

LOCAL_SRC = pikrellcam.c mmalcam.c motion.c event.c display.c config.c servo.c \
preset.c sunriset.c multicast.c tcpserver.c tcpserver.c tcpserver_mjpeg.c
LOCAL_SRC = pikrellcam.c mmalcam.c motion.c event.c display.c config.c \
servo.c preset.c sunriset.c multicast.c audio.c \
tcpserver.c tcpserver.c tcpserver_mjpeg.c

KRELLMLIB_SRC = $(wildcard $(addsuffix /*.c,$(LIBKRELLM_DIRS)))
SOURCES = $(LOCAL_SRC) $(KRELLMLIB_SRC)
Expand Down
Loading

0 comments on commit c9f162d

Please sign in to comment.