pyav / libav 引发 ImportError

pyav / libav raises ImportError

我有一个代码 运行 在 Ubuntu 机器上完美运行,但在另一台机器上返回错误:

from av._core import time_base, pyav_version as __version__, library_versions
ImportError: libavdevice-67a93a2b.so.58.10.100: cannot open shared object file: No such file or directory

我只是在不同的线程中同时摄取多个视频流:

import av
import time

URL = "RTSP_url"
container = av.open(
            url, 'r',
            options={
                'rtsp_transport': 'tcp',
                'stimeout': '5000000',
                'max_delay': '5000000',
            }
        )

for packet in self.container.demux(video=0):
    for frame in packet.decode():
        # do something
        time.sleep(10)

重新安装 pyav 解决了问题:pip3 install av