Skip to content

Commit 5fd38fe

Browse files
committed
update ffmpeg config
1 parent 5272cce commit 5fd38fe

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

source/_posts/2017-02-04-babyphone.markdown

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,19 @@ We setup a icecast mount point for our babyphone and update `/etc/icecast2/iceca
4242
<password>stream_pw</password>
4343
</mount>
4444
```
45+
46+
So now we can add the noise sensor to Home-Assistant. I do not want to be awaiken with every cough of the little child, so we should be at least 2 seconds for option `duration`. The sensor should wait 60 seconds before restoring and it prevent us that a wine break will triggering a new alarm.
47+
48+
We optimize the audio stream for human voice sound. It use a highpass filter with 300Hz and a lowpass filter from 2500Hz. This filter all frequenze with none human voice. Use this filter for reduce background noice. This example add also a volume amplifier that help if the micro volume is to low. If you don't want it, remove the filter from `extra_arguments`. For icecast2 we convert it to mp3 with samplerate of 16000 (that is the minimum for sonos systems). We use `peak` to set the threshold of detecting noise, in dB. 0 is very loud and -100 is low.
49+
50+
```yaml
51+
binary_sensor:
52+
- platform: ffmpeg_noise
53+
input: rtsp://user:pw@my_input/video
54+
extra_arguments: -filter:a highpass=f=300,lowpass=f=2500,volume=volume=2 -codec:a libmp3lame -ar 16000
55+
output: -f mp3 icecast://stream_user:stream_pw@127.0.0.1:8000/babyphone.mp3
56+
initial_state: false
57+
duration: 2
58+
reset: 60
59+
peak: -32
60+
```

0 commit comments

Comments
 (0)