#!/bin/bash while [ 1 ]; do # denoise 10:10:10:10 # if ! /usr/bin/ffmpeg -f v4l2 -video_size 1280x720 -framerate 10 -input_format yuyv422 -i /dev/video2 -an -sn -vf "hqdn3d=10:10:10:10,drawtext=fontfile=monofonto.ttf: fontsize=24: box=1: boxcolor=black@0.5: boxborderw=5: fontcolor=white: x=10: y=10: text='%{localtime\:%d.%m.%Y %H\\\\\:%M\\\\\:%S}'" -f webm -cluster_size_limit 2M -cluster_time_limit 1100 -content_type video/webm -c:v libvpx -crf 30 -b:v 600k -g 15 -deadline realtime -cpu-used 6 -threads 4 icecast://source:846d160e6a2f5ac2e5466d4e52ba6870169511024bb16f6a89bb3e79e01544a3@icecast.streaming.server:8000/outside_cam < /dev/null ; then # denoise 10:10:10:10 # with sound if ! /usr/bin/ffmpeg -f pulse -i alsa_input.pci-0000_00_1b.0.analog-stereo -f v4l2 -video_size 1280x720 -framerate 10 -input_format yuyv422 -i /dev/video2 -sn -vf "hqdn3d=10:10:10:10,drawtext=fontfile=monofonto.ttf: fontsize=24: box=1: boxcolor=black@0.5: boxborderw=5: fontcolor=white: x=10: y=10: text='%{localtime\:%d.%m.%Y %H\\\\\:%M\\\\\:%S}'" -f webm -cluster_size_limit 2M -cluster_time_limit 1100 -content_type video/webm -c:v libvpx -crf 30 -b:v 600k -c:a libvorbis -q 0 -g 15 -deadline realtime -cpu-used 6 -threads 4 icecast://source:846d160e6a2f5ac2e5466d4e52ba6870169511024bb16f6a89bb3e79e01544a3@icecast.streaming.server:8000/outside_cam < /dev/null ; then sleep 5; fi done