A small script to capture video stream (eg: from a security camera). The script takes in time in format of HH:MM:SS and created directories based on the current date. Based on the current variables, it outputs the files to /opt/camera/recordings/. It also needs a temp directory, called streams under /opt/camera/.
Usage example (to capture 11 minutes of the stream):
TIME=$1 # in 00:00:00 format
if [ ! -d $CWD/streams]
mkdir -p $CWD/streams
ffmpeg -i "$STREAM" -t $TIME -c copy -an $CWD/streams/$OUT.mkv
if [ ! -d $CWD/recordings/$DATE ]
mkdir -p $CWD/recordings/$DATE
mv $CWD/streams/$OUT.mkv $CWD/recordings/$DATE/$OUT.mkv
If you need help with your IT projects, fee free to contact us for IT support. Our consultants will be more than happy to help.