You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
multi_cam/cam1.sh

16 lines
559 B

#!/bin/bash
time_UNIX=$(date +%s)
time_HUMAN=$(date '+video_%d.%m.%y_%H:%M:%S')
PID_1=$(ffmpeg -nostdin -f v4l2 -framerate 20 -video_size 320x240 -i /dev/video0 -filter_complex "drawtext=fontfile=/usr/share/fonts/truetype/arial.ttf: text='%{pts\:localtime\:$time_UNIX\:%d.%m.%Y %T}': x=180 : y=5 : box=1" -c:a copy $(echo $time_HUMAN)_1.mp4 &> /dev/null) &
sleep 1
ffmpeg_str=$(ps auxw | grep "copy $(echo $time_HUMAN)_1.mp4" | head -n1)
array=( $ffmpeg_str )
echo ${array[1]} > /tmp/pid_1
#sleep 10
#kill -SIGINT $(cat /tmp/pid_1)
#echo Finish record!!!