home-assistant-libs / ha-ffmpeg

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

Add FFVersion class to return ffmpeg version #26

Closed awarecan closed 5 years ago

awarecan commented 5 years ago

Add a handy method to return ffmpeg version information. ~Can only be called before opening a stream.~

Will be used for home-assistant/home-assistant#20314

pvizeli commented 5 years ago

I ask me if we should do it inside tools as FFVersion object. Because this function can't be called if the other task is running.

We should use this format because close is only for streams. https://github.com/awarecan/ha-ffmpeg/blob/ffmpeg-version/haffmpeg/tools.py#L39-L49

After that, we call this object once on the start of ha and cache the result.