<p dir="auto">I got into animation subject.<br>
I get the same exception(s) with two different examples.<br>
I searched the web, I tried to get my head around the exceptions, but now I'm stuck. hence this issue.<br>
I don't know where is the problem.</p>
<p dir="auto">The examples I ran:</p>
<ol dir="auto">
<li>official example: <a href="http://matplotlib.org/examples/animation/moviewriter.html" rel="nofollow">http://matplotlib.org/examples/animation/moviewriter.html</a></li>
<li><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/tacaswell/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/tacaswell">@tacaswell</a> answer on stackoverflow: <a href="http://stackoverflow.com/a/13983801/662323" rel="nofollow">http://stackoverflow.com/a/13983801/662323</a></li>
</ol>
<p dir="auto">the exception(s):</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="python moviewriter.py
/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/tight_layout.py:225: UserWarning: tight_layout : falling back to Agg renderer
  warnings.warn(&quot;tight_layout : falling back to Agg renderer&quot;)
Traceback (most recent call last):
  File &quot;moviewriter.py&quot;, line 34, in &lt;module&gt;
    ani_frame()
  File &quot;moviewriter.py&quot;, line 31, in ani_frame
    ani.save('demo.mp4',writer=writer,dpi=dpi)
  File &quot;/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/animation.py&quot;, line 718, in save
    writer.grab_frame(**savefig_kwargs)
  File &quot;/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/animation.py&quot;, line 204, in grab_frame
    dpi=self.dpi, **savefig_kwargs)
  File &quot;/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/figure.py&quot;, line 1421, in savefig
    self.canvas.print_figure(*args, **kwargs)
  File &quot;/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/backend_bases.py&quot;, line 2220, in print_figure
    **kwargs)
  File &quot;/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/backends/backend_agg.py&quot;, line 497, in print_raw
    renderer._renderer.write_rgba(filename_or_obj)
RuntimeError: Error writing to file"><pre class="notranslate"><span class="pl-s1">python</span> <span class="pl-s1">moviewriter</span>.<span class="pl-s1">py</span>
<span class="pl-c1">/</span><span class="pl-v">Users</span><span class="pl-c1">/</span><span class="pl-s1">ifmichael</span><span class="pl-c1">/</span><span class="pl-s1">anaconda</span><span class="pl-c1">/</span><span class="pl-s1">lib</span><span class="pl-c1">/</span><span class="pl-s1">python2</span>.<span class="pl-c1">7</span><span class="pl-c1">/</span><span class="pl-s1">site</span><span class="pl-c1">-</span><span class="pl-s1">packages</span><span class="pl-c1">/</span><span class="pl-s1">matplotlib</span><span class="pl-c1">/</span><span class="pl-s1">tight_layout</span>.<span class="pl-s1">py</span>:<span class="pl-c1">225</span>: <span class="pl-v">UserWarning</span>: <span class="pl-s1">tight_layout</span> : <span class="pl-s1">falling</span> <span class="pl-s1">back</span> <span class="pl-s1">to</span> <span class="pl-v">Agg</span> <span class="pl-s1">renderer</span>
  <span class="pl-s1">warnings</span>.<span class="pl-en">warn</span>(<span class="pl-s">"tight_layout : falling back to Agg renderer"</span>)
<span class="pl-v">Traceback</span> (<span class="pl-s1">most</span> <span class="pl-s1">recent</span> <span class="pl-s1">call</span> <span class="pl-s1">last</span>):
  <span class="pl-v">File</span> <span class="pl-s">"moviewriter.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">34</span>, <span class="pl-s1">in</span> <span class="pl-c1">&lt;</span><span class="pl-s1">module</span><span class="pl-c1">&gt;</span>
    <span class="pl-en">ani_frame</span>()
  <span class="pl-v">File</span> <span class="pl-s">"moviewriter.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">31</span>, <span class="pl-s1">in</span> <span class="pl-s1">ani_frame</span>
    <span class="pl-s1">ani</span>.<span class="pl-en">save</span>(<span class="pl-s">'demo.mp4'</span>,<span class="pl-s1">writer</span><span class="pl-c1">=</span><span class="pl-s1">writer</span>,<span class="pl-s1">dpi</span><span class="pl-c1">=</span><span class="pl-s1">dpi</span>)
  <span class="pl-v">File</span> <span class="pl-s">"/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/animation.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">718</span>, <span class="pl-s1">in</span> <span class="pl-s1">save</span>
    <span class="pl-s1">writer</span>.<span class="pl-en">grab_frame</span>(<span class="pl-c1">**</span><span class="pl-s1">savefig_kwargs</span>)
  <span class="pl-v">File</span> <span class="pl-s">"/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/animation.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">204</span>, <span class="pl-s1">in</span> <span class="pl-s1">grab_frame</span>
    <span class="pl-s1">dpi</span><span class="pl-c1">=</span><span class="pl-s1">self</span>.<span class="pl-s1">dpi</span>, <span class="pl-c1">**</span><span class="pl-s1">savefig_kwargs</span>)
  <span class="pl-v">File</span> <span class="pl-s">"/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/figure.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">1421</span>, <span class="pl-s1">in</span> <span class="pl-s1">savefig</span>
    <span class="pl-s1">self</span>.<span class="pl-s1">canvas</span>.<span class="pl-en">print_figure</span>(<span class="pl-c1">*</span><span class="pl-s1">args</span>, <span class="pl-c1">**</span><span class="pl-s1">kwargs</span>)
  <span class="pl-v">File</span> <span class="pl-s">"/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/backend_bases.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">2220</span>, <span class="pl-s1">in</span> <span class="pl-s1">print_figure</span>
    <span class="pl-c1">**</span><span class="pl-s1">kwargs</span>)
  <span class="pl-v">File</span> <span class="pl-s">"/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/backends/backend_agg.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">497</span>, <span class="pl-s1">in</span> <span class="pl-s1">print_raw</span>
    <span class="pl-s1">renderer</span>.<span class="pl-s1">_renderer</span>.<span class="pl-en">write_rgba</span>(<span class="pl-s1">filename_or_obj</span>)
<span class="pl-v">RuntimeError</span>: <span class="pl-v">Error</span> <span class="pl-s1">writing</span> <span class="pl-s1">to</span> <span class="pl-s1">file</span></pre></div>
<p dir="auto">my configuration<br>
macosx mavericks 10.9.4<br>
anaconda bundle<br>
matplotlib 1.3.1 (as 1.4.2 still doesn't work in my configuration, the ascii bug <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="42731654" data-permission-text="Title is private" data-url="https://github.com/matplotlib/matplotlib/issues/3517" data-hovercard-type="issue" data-hovercard-url="/matplotlib/matplotlib/issues/3517/hovercard" href="https://github.com/matplotlib/matplotlib/issues/3517">#3517</a> still prevails)</p>
<p dir="auto">matplotlib.get_backend() gives 'MacOSX'</p>
<p dir="auto">I've installed ffmpeg and mencoder (through homebrew)<br>
matplotlib.animation.writers.list() recognizes both codecs</p>
<p dir="auto">Any help on this? is it a bug or a problem with my configuration?</p>
<p dir="auto">I am having trouble saving my animations using ffmpeg 2.0.1<br>
The temp files get created, but the call to ffmpeg fails with the following error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Option vframes (set the number of video frames to record) cannot be applied to input file _tmp%07d.png -- you are trying to apply an input option to an output file or vice versa. Move this option before the file it belongs to.
Error parsing options for input file _tmp%07d.png.
Error opening input files: Invalid argument"><pre class="notranslate"><code class="notranslate">Option vframes (set the number of video frames to record) cannot be applied to input file _tmp%07d.png -- you are trying to apply an input option to an output file or vice versa. Move this option before the file it belongs to.
Error parsing options for input file _tmp%07d.png.
Error opening input files: Invalid argument
</code></pre></div>
<p dir="auto">I am assuming the way in which ffmpeg takes arguments has changed between versions?</p>