core.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:ha-ffmpeg 作者: pvizeli 项目源码 文件源码
def close(self, timeout=5):
        """Stop a ffmpeg instance."""
        if not self.is_running:
            _LOGGER.warning("FFmpeg isn't running!")
            return

        try:
            # send stop to ffmpeg
            with async_timeout.timeout(timeout, loop=self._loop):
                yield from self._proc.communicate(input=b'q')
            _LOGGER.debug("Close FFmpeg process")

        except (asyncio.TimeoutError, ValueError):
            _LOGGER.warning("Timeout while waiting of FFmpeg")
            self._proc.kill()

        finally:
            self._clear()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号