The linked code is correct. In some environments (like Deepnote), however, you have to install extra dependencies as suggested in this answer.
!apt update
!apt install ffmpeg libsm6 libxext6 -y
Here's an example notebook of this working properly. Specifically in Deepnote, you can move the apt
and pip
install calls into a Custom environments Dockerfile.
In the future, please be more specific about what is not working.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…