Matplotlib-Animation “No MovieWriters Available”

后端 未结 8 1175
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-07 18:40

Under Linux, I\'ve been checking out matplotlib\'s animation class, and it seems to work except that I cant initialise the movie writer to write out the movie.

Using

相关标签:
8条回答
  • 2020-12-07 18:57

    (be sure to follow JPH feedback above about the proper ffmpeg download) Not sure why, but in my case here is the one that worked (in my case was on windows).

    Initialize a writer:

    import matplotlib.pyplot as plt
    import matplotlib.animation as animation
    Writer = animation.FFMpegWriter(fps=30, codec='libx264')  #or 
    Writer = animation.FFMpegWriter(fps=20, metadata=dict(artist='Me'), bitrate=1800) ==> This is WORKED FINE ^_^
    

    Writer = animation.writers['ffmpeg'] ==> GIVES ERROR ""RuntimeError: Requested MovieWriter (ffmpeg) not available""

    0 讨论(0)
  • 2020-12-07 19:00

    Had the same problem....managed to get it to work after a little while.

    Thing to do is follow instructions on installing FFmpeg - which is (at least on windows) a bundle of executables you need to set a path to in your environment variables

    http://www.wikihow.com/Install-FFmpeg-on-Windows

    Download the exes from here.

    http://ffmpeg.zeranoe.com/builds/

    Hope this helps someone - even after a while after the question - good luck

    0 讨论(0)
  • 2020-12-07 19:01

    Had the same problem under Linux. By default the animate.save method is using ffmpeg but it seems to be deprecated. https://askubuntu.com/questions/432542/is-ffmpeg-missing-from-the-official-repositories-in-14-04

    Solution: Install some coder, like avconv or mencoder. Provide the alternative coder in the call:

    ani.save('the_movie.mp4', writer = 'mencoder', fps=15)
    
    0 讨论(0)
  • 2020-12-07 19:01

    I'm running Ubuntu 20 and I had a similar problem

    Installed ffmpeg

    pip install ffmpeg

    then

    sudo apt install ffmpeg

    0 讨论(0)
  • 2020-12-07 19:14

    For fellow googlers using Anaconda, install the ffmpeg package:

    conda install -c conda-forge ffmpeg
    

    This works on Windows too.

    (Original answer used menpo package owner but as mentioned by @harsh their version is a little behind at time of writing)

    0 讨论(0)
  • 2020-12-07 19:22

    I know this question is about Linux, but in case someone stumbles on this problem on Mac like I did here is the solution for that. I had the exact same problem on Mac because ffmpeg is not installed by default apparently, and so I could solve it using:

    brew install yasm
    brew install ffmpeg
    
    0 讨论(0)
提交回复
热议问题