I keep getting this error when trying to save my animations in matplotlib:
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
plt.rcParams['animation.ffmpeg_path'] = 'C:\FFmpeg\bin'
fig, ax = plt.subplots()
ax.set_xlim(-0.1 ,2*np.pi + 0.1)
ax.set_ylim(-1.1 ,1.1)
ln, = plt.plot([], [], '-')
x = np.linspace(0,2*np.pi,1000)
def update(frame):
y = frame*np.sin(x)
ln.set_data(x,y)
return ln,
ani = FuncAnimation(fig,
update,
frames=np.linspace(1,-1,1000),
interval=1000/144)
ani.save('lol.gif')
MovieWriter ffmpeg unavailable. Trying to use pillow instead.
This is a repetition of an unanswered question: UserWarning: MovieWriter ffmpeg unavailable
I tried running a sample code from here, but it still says ffmpeg isn't available, even though I installed and activated it according to wikihow. So even setting the path to the binary doesn't seem to work.
I can't set the fps or the dpi, or anything since the save
function just defaults. What can I do so that python finally starts using ffmpeg?