Last active
September 3, 2020 06:57
-
-
Save gionn/8196479db4114282fbc0a5ce9fb7c73a to your computer and use it in GitHub Desktop.
Grab snapshot (single frame) from RTSP ipcam and publish to S3
This file contains hidden or 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/bash -e | |
# Move inside a tmpfs directory | |
cd /dev/shm | |
# Grab a snapshot of the RTSP source and save on current folder | |
# rtsp_transport tcp to avoid packet loss (truncated image) | |
# qscale:v to adjust jpeg quality (2 is best, 31 worst) | |
ffmpeg -loglevel panic -y -rtsp_transport tcp -i rtsp://192.168.199.91 -vframes 1 -qscale:v 4 snapshot.jpg | |
# Upload to S3 - (requires a .s3cfg in home directory) | |
s3cmd put -P snapshot.jpg s3://bucket | |
echo Done! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment