Aufnahme auf ffmpeg umgestellt, Dateilänge = 1 Stunde;Ueberappung = 1 Minute
This commit is contained in:
parent
1efb776316
commit
6f2dd79c3d
16
Dump.sh
16
Dump.sh
|
@ -7,16 +7,19 @@ USERNAME=admin
|
||||||
PASSWORD="123456"
|
PASSWORD="123456"
|
||||||
CAMERAS="0 1 2 3 4 5 6 7 8 9"
|
CAMERAS="0 1 2 3 4 5 6 7 8 9"
|
||||||
# the real values _will_ differ depending on the machine running the script !!!
|
# the real values _will_ differ depending on the machine running the script !!!
|
||||||
SECONDS_PER_FILE=60
|
SECONDS_PER_FILE=3600
|
||||||
OVERLAP_PER_FILE=2
|
OVERLAP_PER_FILE=60
|
||||||
|
|
||||||
PIDFILE_BASE=/tmp/wget_script.$RANDOM.pids
|
PIDFILE_BASE=/tmp/wget_script.$RANDOM.pids
|
||||||
if [ -z "$NAME" ]; then
|
if [ -z "$NAME" ]; then
|
||||||
NAME=0
|
NAME=0
|
||||||
fi
|
fi
|
||||||
CAPTURE_DIR="$( dirname "${BASH_SOURCE[0]}" )/capture"
|
SCRIPT_DIR="$( cd $( dirname "${BASH_SOURCE[0]}" ); pwd )/"
|
||||||
|
CAPTURE_DIR="${SCRIPT_DIR}/capture/"
|
||||||
mkdir -p $CAPTURE_DIR
|
mkdir -p $CAPTURE_DIR
|
||||||
cd $CAPTURE_DIR
|
cd $CAPTURE_DIR
|
||||||
|
#OUT_FILE_TYPE="mjpeg"
|
||||||
|
OUT_FILE_TYPE="avi"
|
||||||
|
|
||||||
SHUTDOWN_IN_PROGRESS="false"
|
SHUTDOWN_IN_PROGRESS="false"
|
||||||
quit() {
|
quit() {
|
||||||
|
@ -35,18 +38,19 @@ trap 'quit 0' SIGINT SIGTERM EXIT
|
||||||
do_record() {
|
do_record() {
|
||||||
for i in $CAMERAS; do
|
for i in $CAMERAS; do
|
||||||
echo "starting recording for camera $i" >&2
|
echo "starting recording for camera $i" >&2
|
||||||
OUTFILE_START=tmp_dump_cam_${i}_$(date +%s.%N)_RANDOM$RANDOM.mjpg
|
OUTFILE_START=tmp_dump_cam_${i}_$(date +%s.%N)_RANDOM$RANDOM.$OUT_FILE_TYPE
|
||||||
(
|
(
|
||||||
EXACT_START_TIME=$(date +%s.%N)
|
EXACT_START_TIME=$(date +%s.%N)
|
||||||
outfile_close_trap() {
|
outfile_close_trap() {
|
||||||
echo "finishing capture file for camera $i"
|
echo "finishing capture file for camera $i"
|
||||||
EXACT_END_TIME=$(date +%s.%N)
|
EXACT_END_TIME=$(date +%s.%N)
|
||||||
if [ -f $OUTFILE_START ]; then
|
if [ -f $OUTFILE_START ]; then
|
||||||
mv $OUTFILE_START dump_cam_${i}_${EXACT_START_TIME}_${EXACT_END_TIME}.mjpg
|
mv $OUTFILE_START dump_cam_${i}_${EXACT_START_TIME}_${EXACT_END_TIME}.$OUT_FILE_TYPE
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
trap outfile_close_trap SIGINT SIGTERM EXIT
|
trap outfile_close_trap SIGINT SIGTERM EXIT
|
||||||
wget --ignore-length --http-user=$USERNAME --http-passwd=$PASSWORD http://${SERVER_IP}:$PORT/cam/$i/stream.mjpeg -O $OUTFILE_START -q 2>&1 >> /dev/null &
|
#wget --ignore-length --http-user=$USERNAME --http-passwd=$PASSWORD http://${SERVER_IP}:$PORT/cam/$i/stream.mjpeg -O $OUTFILE_START -q >> /dev/null 2>&1 &
|
||||||
|
${SCRIPT_DIR}/ffmpeg -use_wallclock_as_timestamps 1 -f mjpeg -i http://$USERNAME:$PASSWORD@${SERVER_IP}:$PORT:8080/cam/$i/stream.mjpeg -c copy -ts abs -y $OUTFILE_START >> /dev/null 2>&1 &
|
||||||
THIS_WGET_PID=$!
|
THIS_WGET_PID=$!
|
||||||
echo $THIS_WGET_PID >> ${PIDFILE_BASE}_${1}
|
echo $THIS_WGET_PID >> ${PIDFILE_BASE}_${1}
|
||||||
wait $THIS_WGET_PID
|
wait $THIS_WGET_PID
|
||||||
|
|
Loading…
Reference in New Issue