Last active
December 16, 2015 00:59
-
-
Save fishkingsin/5351264 to your computer and use it in GitHub Desktop.
recording my home raspberry pi ip cam and convert to mp4
an unix script trap ctrl-c study
catch crtl-c and convert by ffmpeg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# zpg - UNCOMPRESS FILE, DISPLAY WITH pg | |
# Usage: download mjpeg and recording to mp4 | |
PREFIX=$(date +%Y%m%d%H%M%S) | |
# trap ctrl-c and call ctrl_c() | |
trap ctrl_c INT | |
function ctrl_c() { | |
echo "** Trapped CTRL-C" | |
ffmpeg -i $PREFIX.mjpg $PREFIX.mp4 | |
} | |
wget --password=namnamlu --user=littleo -O $PREFIX.mjpg http://fishkingsin.no-ip.info/?action=stream |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment