home-assistant-libs / ha-ffmpeg

A python library that handling with ffmpeg for home-assistant
BSD 3-Clause "New" or "Revised" License
17 stars 13 forks source link

Check if ffmpeg open was successful before reading image frame #17

Closed rsalveti closed 6 years ago

rsalveti commented 7 years ago

HAFFmpeg open can fail in case FFmpeg fails, so check for self._proc before using it to read the image frame.

Fixes:

File "/usr/lib/python3.6/site-packages/haffmpeg/tools.py", line 82, in get_image self._proc.communicate(), loop=self._loop) AttributeError: 'NoneType' object has no attribute 'communicate'

Signed-off-by: Ricardo Salveti rsalveti@rsalveti.net