title: "The system cannot find the file specified" when animating with ffmpeg in matplotlib
body: <p>I am trying to generate a movie from a stack of numpy arrays using a function I have used on a different computer (a mac) on my home computer (Windows 10). Here is the function that I am using:</p>
  
  <pre><code>def make_animation(frames,name): 
  
      plt.rcParams['animation.ffmpeg_path'] = u'C:\ffmpeg-20190320-0739d5c-win64-static\bin\ffmpeg.exe' 
      n_images=frames.shape[2] 
      assert (n_images&gt;1)   
      figsize=(10,10)
      fig, ax = plt.subplots(figsize=figsize)
      fig.tight_layout()
      fig.subplots_adjust(left=0, bottom=0, right=1, top=1, wspace=None, hspace=None)
      #lineR, = ax.plot(xaxis_data[0],R_data[0],'c-',label="resources")
      img = ax.imshow(frames[:,:,0], animated = True)   
  
  
      def updatefig(img_num): 
  
          #lineR.set_data(xaxis_data[img_num],R_data[img_num],'r-')
  
          img.set_data(frames[:,:,img_num])
  
          return [img]
  
  
      ani = animation.FuncAnimation(fig, updatefig, np.arange(1, n_images), interval=50, blit=True)
      mywriter = animation.FFMpegWriter(fps = 20)
      #ani.save('mymovie.mp4',writer=mywriter)
  
      ani.save(f"D:\{name}.mp4",writer=mywriter)
  
      plt.close(fig)
  </code></pre>
  
  <p>Here is the error that I am getting:</p>
  
  <pre><code>Traceback (most recent call last):
  
    File "&lt;ipython-input-48-8861d4da3f36&gt;", line 1, in &lt;module&gt;
      make_animation(stack,'full_test')
  
    File "&lt;ipython-input-47-0e3683911f60&gt;", line 27, in make_animation
      ani.save(f"D:\{name}.mp4",writer=mywriter)
  
    File "C:\Users\~snip~\Anaconda3\lib\site-packages\matplotlib\animation.py", line 1136, in save
      with writer.saving(self._fig, filename, dpi):
  
    File "C:\Users\~snip~\Anaconda3\lib\contextlib.py", line 112, in __enter__
      return next(self.gen)
  
    File "C:\Users\~snip~\Anaconda3\lib\site-packages\matplotlib\animation.py", line 228, in saving
      self.setup(fig, outfile, dpi, *args, **kwargs)
  
    File "C:\Users\~snip~\Anaconda3\lib\site-packages\matplotlib\animation.py", line 352, in setup
      self._run()
  
    File "C:\Users\~snip~\Anaconda3\lib\site-packages\matplotlib\animation.py", line 363, in _run
      creationflags=subprocess_creation_flags)
  
    File "C:\Users\~snip~\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 143, in __init__
      super(SubprocessPopen, self).__init__(*args, **kwargs)
  
    File "C:\Users\~snip~\Anaconda3\lib\subprocess.py", line 775, in __init__
      restore_signals, start_new_session)
  
    File "C:\Users\~snip~\Anaconda3\lib\subprocess.py", line 1178, in _execute_child
      startupinfo)
  
  FileNotFoundError: [WinError 2] The system cannot find the file specified
  </code></pre>
  
  <p>I know this code basically works since I have used it before on another computer. My guess is that something about ffmpeg is messed up or something about the output path is wrong. I'm not sure what could be wrong with the ffmpeg since I definitely have it installed (via conda) and the path is pretty straightforward. On the other hand I'm not sure what could be wrong with the output path.</p>