Skip to content

Instantly share code, notes, and snippets.

@ExploitSage
Created March 14, 2018 13:48
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 ExploitSage/d9e5b1d7ec8a62ba9a52c2a10ccc1bfa to your computer and use it in GitHub Desktop.
Save ExploitSage/d9e5b1d7ec8a62ba9a52c2a10ccc1bfa to your computer and use it in GitHub Desktop.
Grab the current frame from an MJPG/MJPEG Stream and save as a PNG Image
#!/bin/bash
NOW=$(TZ='America/Chicago' date +%Y-%m-%d_%H%M)
FILENAME=/path/to/directory/image_$NOW.png
STREAMURL=http://127.0.0.1:6000/video.mjpg
ffmpeg -i "$STREAMURL" -f image2 -vframes 1 "$FILENAME"
convert "$FILENAME" -gravity SouthEast -pointsize 22 -fill white -annotate +10+10 "$NOW" "$FILENAME"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment