Skip to content

Instantly share code, notes, and snippets.

@fishkingsin
Last active December 16, 2015 00:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fishkingsin/5351264 to your computer and use it in GitHub Desktop.
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
#!/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