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.
12 lines
493 B
12 lines
493 B
4 years ago
|
#!/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/video1 -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)_2.mp4 &> /dev/null) &
|
||
|
|
||
|
sleep 1
|
||
|
|
||
|
ffmpeg_str=$(ps auxw | grep "copy $(echo $time_HUMAN)_2.mp4" | head -n1)
|
||
|
array=( $ffmpeg_str )
|
||
|
echo ${array[1]} > /tmp/pid_2
|