Skip to content

Instantly share code, notes, and snippets.

@lkysow
Created November 11, 2014 03:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lkysow/4002781c32ed2ac15d59 to your computer and use it in GitHub Desktop.
Save lkysow/4002781c32ed2ac15d59 to your computer and use it in GitHub Desktop.
Quick and dirty script to chunk an RTSP stream for our hackathon project
while true;
do
rm out.mp4
date=$(date +%s)
ffmpeg -i rtsp://192.168.5.151:8086 -strict experimental -vf "transpose=1" -r 15 -t 10 out.mp4;
sleep 5;
ffmpeg -i out.mp4 -deinterlace -an -ss 0 -t 00:00:01 -r 1 -y -vcodec mjpeg -f mjpeg out-thumbnail.jpg 2>&1
mv out.mp4 ~/Pictures/videos/VID_$date.mp4
mv out-thumbnail.jpg ~/Pictures/videos/VID_$date.mp4-thumbnail.jpg
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment