From c75e45aa5d4a60681ab25ba82ac7c9286c439180 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Wed, 14 Sep 2016 16:24:03 +0200 Subject: [PATCH 1/9] Create ffmpeg.markdown --- source/_components/ffmpeg.markdown | 45 ++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 source/_components/ffmpeg.markdown diff --git a/source/_components/ffmpeg.markdown b/source/_components/ffmpeg.markdown new file mode 100644 index 00000000000..eda10178742 --- /dev/null +++ b/source/_components/ffmpeg.markdown @@ -0,0 +1,45 @@ +--- +layout: page +title: "FFmpeg" +description: "Instructions for how to integrate FFmpeg within Home Assistant." +date: 2016-09-14 00:00 +sidebar: true +comments: false +sharing: true +footer: true +logo: sleepiq +ha_category: Hub +featured: true +--- + +

+You need a `ffmpeg` binary in your system path. On Debain 8 you can install it from backports. If you want Hardware support on a Raspberry Pi you need tobuild from source by yourself. Windows binary are avilable on the [FFmpeg](http://www.ffmpeg.org/) website. +

+ +To set it up, add the following information to your `configuration.yaml` file: + +```yaml +ffmpeg: + ffmpeg_bin: /usr/bin/ffmpeg + run_test: True +``` + +Configuration variables: + +- **ffmpeg_bin** (*Optional*): Default 'ffmpeg'. Set the ffmpeg binary. +- **run_test** (*Optional*): Default True. Check if `input` is usable by ffmpeg. + +### {% linkable_title Troubleshooting %} + +In most of case, `ffmpeg` autodetect all needed options to read a video/audio stream or file. But it is possible in rare cases that's needed to set a option to help `ffmpeg`. Per default `ffmpeg` use 5 seconds to detect all options or abort. + +First check, if your stream playable by `ffmpeg` with (use option `-an` or `-vn` to disable video or audio stream): + +``` +$ ffmpeg -i INPUT -an -f null - +``` + +Now you can see what going wrong. Following list could be help to solve your trouble: + +- `[rtsp @ ...] UDP timeout, retrying with TCP`: You need to set RTSP transport in the configuration with: `input: -rtsp_transport tcp -i INPUT` +- `[rtsp @ ...] Could not find codec parameters for stream 0 (Video: ..., none): unspecified size`: FFmpeg need more data or time for autodetect. You can set the `analyzeduration` and/or `probesize` option, play with this value. If you know the needed value you can set it with: `input: -analyzeduration xy -probesize xy -i INPUT`. More information about that can be found on [FFmpeg](https://www.ffmpeg.org/ffmpeg-formats.html#Description). From 01e2540083b68a5083a3f8540c7a67d784639306 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Wed, 14 Sep 2016 16:27:32 +0200 Subject: [PATCH 2/9] Update binary_sensor.ffmpeg.markdown --- source/_components/binary_sensor.ffmpeg.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/_components/binary_sensor.ffmpeg.markdown b/source/_components/binary_sensor.ffmpeg.markdown index 4a14494725c..f613b840e0a 100644 --- a/source/_components/binary_sensor.ffmpeg.markdown +++ b/source/_components/binary_sensor.ffmpeg.markdown @@ -95,4 +95,4 @@ For playing with values (changes/100 is the scene value on ffmpeg): $ ffmpeg -i YOUR_INPUT -an -filter:v select=gt(scene\,0.1) -f framemd5 - ``` -If you are running into trouble with this sensor, please refer to this [Troubleshooting section](/components/camera.ffmpeg/#troubleshooting). +If you are running into trouble with this sensor, please refer to this [Troubleshooting section](/components/ffmpeg/#troubleshooting). From 575e802b9dfdbeb93eac346f728ed9874ab599a5 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Wed, 14 Sep 2016 16:28:38 +0200 Subject: [PATCH 3/9] Update camera.ffmpeg.markdown --- source/_components/camera.ffmpeg.markdown | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/source/_components/camera.ffmpeg.markdown b/source/_components/camera.ffmpeg.markdown index 71c14c789b5..40f1472c4db 100644 --- a/source/_components/camera.ffmpeg.markdown +++ b/source/_components/camera.ffmpeg.markdown @@ -42,18 +42,6 @@ Configuration variables: You can control the `image quality` with [`extra_arguments`](https://www.ffmpeg.org/ffmpeg-codecs.html#jpeg2000) `-q:v 2-32` or with lossless option `-pred 1`. -### {% linkable_title Troubleshooting %} -In most of case, `ffmpeg` autodetect all needed options to read a video/audio stream or file. But it is possible in rare cases that's needed to set a option to help `ffmpeg`. Per default `ffmpeg` use 5 seconds to detect all options or abort. - -First check, if your stream playable by `ffmpeg` with (use option `-an` or `-vn` to disable video or audio stream): - -``` -$ ffmpeg -i INPUT -an -f null - -``` - -Now you can see what going wrong. Following list could be help to solve your trouble: - -- `[rtsp @ ...] UDP timeout, retrying with TCP`: You need to set RTSP transport in the configuration with: `input: -rtsp_transport tcp -i INPUT` -- `[rtsp @ ...] Could not find codec parameters for stream 0 (Video: ..., none): unspecified size`: FFmpeg need more data or time for autodetect. You can set the `analyzeduration` and/or `probesize` option, play with this value. If you know the needed value you can set it with: `input: -analyzeduration xy -probesize xy -i INPUT`. More information about that can be found on [FFmpeg](https://www.ffmpeg.org/ffmpeg-formats.html#Description). +If you are running into trouble with this sensor, please refer to this [Troubleshooting section](/components/ffmpeg/#troubleshooting). From e2aed7320e8556ab9aae439ece2f2589bd6cf50e Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Wed, 14 Sep 2016 16:31:27 +0200 Subject: [PATCH 4/9] Update ffmpeg.markdown --- source/_components/ffmpeg.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/_components/ffmpeg.markdown b/source/_components/ffmpeg.markdown index eda10178742..91e4df83866 100644 --- a/source/_components/ffmpeg.markdown +++ b/source/_components/ffmpeg.markdown @@ -7,7 +7,7 @@ sidebar: true comments: false sharing: true footer: true -logo: sleepiq +logo: ffmpeg.png ha_category: Hub featured: true --- From c44185788013585ea006b25e5d119239dbbad4b5 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Wed, 14 Sep 2016 16:32:18 +0200 Subject: [PATCH 5/9] Update binary_sensor.ffmpeg.markdown --- source/_components/binary_sensor.ffmpeg.markdown | 4 ---- 1 file changed, 4 deletions(-) diff --git a/source/_components/binary_sensor.ffmpeg.markdown b/source/_components/binary_sensor.ffmpeg.markdown index f613b840e0a..b537e5360a8 100644 --- a/source/_components/binary_sensor.ffmpeg.markdown +++ b/source/_components/binary_sensor.ffmpeg.markdown @@ -16,10 +16,6 @@ ha_iot_class: "Local Polling" The `ffmpeg` platform allows you to use every video or audio feed with [FFmpeg](http://www.ffmpeg.org/) for various sensors in Home Assistant. Available are: **noise**, **motion**. If the `ffmpeg` process is broken, the sensor will be unavailable. To restart the instance, use the service *binary_sensor.ffmpeg_restart*. -

-You need the `ffmpeg` binary in your system path. On Debain 8 you can install it from backports. If you want Hardware support on a Raspberry Pi you need to build it from source. Windows binary are avilable on [FFmpeg](http://www.ffmpeg.org/) homepage. -

- ### {% linkable_title Noise %} To enable your FFmpeg with noise detection in your installation, add the following to your `configuration.yaml` file: From 05657982f3b60d2470de492f6f8ed44ff160c1fb Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Wed, 14 Sep 2016 16:32:50 +0200 Subject: [PATCH 6/9] Update camera.ffmpeg.markdown --- source/_components/camera.ffmpeg.markdown | 4 ---- 1 file changed, 4 deletions(-) diff --git a/source/_components/camera.ffmpeg.markdown b/source/_components/camera.ffmpeg.markdown index 40f1472c4db..628775ffb73 100644 --- a/source/_components/camera.ffmpeg.markdown +++ b/source/_components/camera.ffmpeg.markdown @@ -15,10 +15,6 @@ ha_release: 0.26 The `ffmpeg` platform allows you to use every video feed with [FFmpeg](http://www.ffmpeg.org/) as camera in Home Assistant. The input for ffmpeg need to support that could have multiple connection to source (input) in same time. For every user in UI and all 10 seconds (snapshot image) it make a new connection/reading to source. Normally that should never be a trouble only in strange selfmade constructs can be make mistakes. -

-You need a `ffmpeg` binary in your system path. On Debain 8 you can install it from backports. If you want Hardware support on a Raspberry Pi you need tobuild from source by yourself. Windows binary are avilable on the [FFmpeg](http://www.ffmpeg.org/) website. -

- To enable your FFmpeg feed in your installation, add the following to your `configuration.yaml` file: ```yaml From 3e6b3f846a6659a6709935248b5fd9082b179688 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Wed, 14 Sep 2016 16:39:14 +0200 Subject: [PATCH 7/9] Update binary_sensor.ffmpeg.markdown --- source/_components/binary_sensor.ffmpeg.markdown | 2 -- 1 file changed, 2 deletions(-) diff --git a/source/_components/binary_sensor.ffmpeg.markdown b/source/_components/binary_sensor.ffmpeg.markdown index b537e5360a8..b75be6458d1 100644 --- a/source/_components/binary_sensor.ffmpeg.markdown +++ b/source/_components/binary_sensor.ffmpeg.markdown @@ -27,7 +27,6 @@ camera: tool: noise input: FFMPEG_SUPPORTED_INPUT name: FFmpeg Noise - ffmpeg_bin: /usr/bin/ffmpeg peak: -30 duration: 1 reset: 20 @@ -64,7 +63,6 @@ camera: tool: motion input: FFMPEG_SUPPORTED_INPUT name: FFmpeg Motion - ffmpeg_bin: /usr/bin/ffmpeg changes: 10 reset: 20 # group feature / default not in use From 1556e5c355a5e83f5a1caf64258d70fdf30937b6 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Wed, 14 Sep 2016 16:39:59 +0200 Subject: [PATCH 8/9] Update camera.ffmpeg.markdown --- source/_components/camera.ffmpeg.markdown | 1 - 1 file changed, 1 deletion(-) diff --git a/source/_components/camera.ffmpeg.markdown b/source/_components/camera.ffmpeg.markdown index 628775ffb73..b6e8f0b7896 100644 --- a/source/_components/camera.ffmpeg.markdown +++ b/source/_components/camera.ffmpeg.markdown @@ -23,7 +23,6 @@ camera: - platform: ffmpeg input: FFMPEG_SUPPORTED_INPUT name: FFmpeg - ffmpeg_bin: /usr/bin/ffmpeg extra_arguments: -q:v 2 ``` From b16ee58f192b38cd5dfbdd226e34ffb77ad9e5e8 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Wed, 14 Sep 2016 18:28:13 +0200 Subject: [PATCH 9/9] Update ffmpeg.markdown --- source/_components/ffmpeg.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/_components/ffmpeg.markdown b/source/_components/ffmpeg.markdown index 91e4df83866..b58e5b9a9b9 100644 --- a/source/_components/ffmpeg.markdown +++ b/source/_components/ffmpeg.markdown @@ -13,7 +13,7 @@ featured: true ---

-You need a `ffmpeg` binary in your system path. On Debain 8 you can install it from backports. If you want Hardware support on a Raspberry Pi you need tobuild from source by yourself. Windows binary are avilable on the [FFmpeg](http://www.ffmpeg.org/) website. +You need a `ffmpeg` binary in your system path. On Debain 8 or Raspbian (Jessie) you can install it from backports. If you want Hardware support on a Raspberry Pi you need to build from source by yourself. Windows binary are avilable on the [FFmpeg](http://www.ffmpeg.org/) website.

To set it up, add the following information to your `configuration.yaml` file: