Rtsp feed with ffmpeg and sricam new install of stretch python 3.6.3

Hi

This may be of use to those that want to upgrade to python 3.6.3 on a fresh install of raspbian and home assistant 0.63.3

I struggled to get my rtsp feed working that was fine with the latest hassbian 1.2.1 and a sricam. The network path worked a treat in VLC player on windows network stream (media-open network stream, paste the rtsp address-open). I have a few of these cameras as they are cheap but good quality (typically less than £15 uk).

my config for the feed now is;

camera 3:
  input: rtsp://xxx.xxx.x.xxx:554/onvif1
  platform: ffmpeg
  name: Cam3

I kept getting permission errors for ffmpeg and the bin so disabled in config;

#ffmpeg:
#ffmpeg_bin: /usr/bin/avconv

I was running this command to see the state of the connection to the camera;

ffmpeg -rtsp_transport tcp -analyzeduration 15 -i rtsp://xxx.xxx.x.xxx:554/onvif1 -an -f null -

This confused things as there was an error; [rtsp @ 0x1221620] Nonmatching transport in server reply rtsp://xxx.xxx.x.xxx:554/onvif1: Invalid data found when processing input
I should have ignored as its still coming up with the error but I have a stable image (they only update every 5 to 10 secs in the hass interface), below is how I got my image back up and streaming to hass;

 sudo apt-get install libavcodec-extra
 sudo apt-get install libav-tools

I also ran this in my virtual environment

sudo su -s /bin/bash homeassistant
source /srv/homeassistant/homeassistant_venv/bin/activate

 sudo apt-get remove ffmpeg
 pip3 install ha-ffmpeg==1.9

exit to pi user

pip3.6 install ha-ffmpeg==1.9

The onvif script addon and configuration using onvif platform didnt work for me.

#camera 3:
  #platform: onvif
  #host: 192.168.1.234
  #name: Front Cam

I’m pretty sure it was the installation of the codec/avconv and the re installation of the ffmpeg ha-ffmpeg==1.9 's that assisted.

On to the sound which is still playing up and the gpio PIR’s which don’t seem to be playing fair.