Saving animations

Hi everybody.

I have been trying to save some animations I made and I encountered


the
problem mentioned here
.

I am using current master.

To be precise, when I use

anim.save("file.mp4", fps=10, extra_args=['-vcodec', 'libx264'])

I get "RuntimeError: Error writing to file" from the agg backend.

If I don't use the extra_args, it works, but I get very, very bad

quality that can not be redeemed using bitrate.

I have ffmpeg and libx264 installed. I also tried the mencoder by

passing

MencoderWriter() to save, but that resulted in a video where all

frames are identical.

Any help on this would be appreciated. Is there an easy way to just

dump

the frames? I can do the mencoder bit myself.

Thanks,

Andy

Exactly which version of mpl are you using, and what is your platform? This will help us diagnose what is going on.

Cheers!
Ben Root

···

On Thu, Oct 4, 2012 at 10:02 AM, Andreas Mueller <amueller@…4089…> wrote:

Hi everybody.

I have been trying to save some animations I made and I encountered


the
problem mentioned here
.

I am using current master.

To be precise, when I use

anim.save("file.mp4", fps=10, extra_args=['-vcodec', 'libx264'])

I get "RuntimeError: Error writing to file" from the agg backend.

If I don't use the extra_args, it works, but I get very, very bad

quality that can not be redeemed using bitrate.

I have ffmpeg and libx264 installed. I also tried the mencoder by

passing

MencoderWriter() to save, but that resulted in a video where all

frames are identical.

Any help on this would be appreciated. Is there an easy way to just

dump

the frames? I can do the mencoder bit myself.



Thanks,

Andy

Thanks for the quick answer.
    I am not on the box but I used master from yesterday, so
    89482b21c8582d49a2ddc2865e472eb404fd07e2
    <https://github.com/matplotlib/matplotlib/commit/89482b21c8582d49a2ddc2865e472eb404fd07e2&gt;,
    I guess.
    The platform is Ubuntu Precise (with loads of random Python
    packages, but that seems somewhat unrelated).
    Cheers,
    Andy

···

On 10/04/2012 03:51 PM, Benjamin Root wrote:

On Thu, Oct 4, 2012 at 10:02 AM, Andreas Mueller > <amueller@...4089... <mailto:amueller@…4089…>> wrote:

    Hi everybody.
    I have been trying to save some animations I made and I
    encountered the problem mentioned here
    <Thread: [matplotlib-devel] Saving animations | matplotlib.
    I am using current master.
    To be precise, when I use
    anim.save("file.mp4", fps=10, extra_args=['-vcodec', 'libx264'])
    I get "RuntimeError: Error writing to file" from the agg backend.
    If I don't use the extra_args, it works, but I get very, very bad
    quality that can not be redeemed using bitrate.
    I have ffmpeg and libx264 installed. I also tried the mencoder by
    passing
    MencoderWriter() to save, but that resulted in a video where all
    frames are identical.

    Any help on this would be appreciated. Is there an easy way to
    just dump
    the frames? I can do the mencoder bit myself.

    Thanks,
    Andy

Exactly which version of mpl are you using, and what is your platform? This will help us diagnose what is going on.

I'm on Ubuntu Precise (12.04) here as well. No problems with/without,
but I'm noticing the extra_args aren't being used (which I think is a
known bug I need to fix.) Can you run with --verbose-debug and post
the relevant output? (Or just compress and attach.)

Ryan

···

On Thu, Oct 4, 2012 at 12:38 PM, Andreas Mueller <amueller@...4089...> wrote:

On 10/04/2012 03:51 PM, Benjamin Root wrote:
On Thu, Oct 4, 2012 at 10:02 AM, Andreas Mueller <amueller@...4089...> > wrote:

Hi everybody.
I have been trying to save some animations I made and I encountered the
problem mentioned here.
I am using current master.
To be precise, when I use
anim.save("file.mp4", fps=10, extra_args=['-vcodec', 'libx264'])
I get "RuntimeError: Error writing to file" from the agg backend.
If I don't use the extra_args, it works, but I get very, very bad
quality that can not be redeemed using bitrate.
I have ffmpeg and libx264 installed. I also tried the mencoder by passing
MencoderWriter() to save, but that resulted in a video where all frames
are identical.

Any help on this would be appreciated. Is there an easy way to just dump
the frames? I can do the mencoder bit myself.

Thanks,
Andy

Exactly which version of mpl are you using, and what is your platform? This
will help us diagnose what is going on.

Thanks for the quick answer.
I am not on the box but I used master from yesterday, so
89482b21c8582d49a2ddc2865e472eb404fd07e2, I guess.
The platform is Ubuntu Precise (with loads of random Python packages, but
that seems somewhat unrelated).

--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma

Thanks for the tip. I didn't know about ``--verbose-debug``.
It told me Unknown encoder 'libx264'.
I found out I need to install libavcodec-extra-53 for it to work.
Not everything is going smoothly.

It would be great if the docs could be updated with how to specify
a codec btw. I only found out by chance.

Thanks for your help, andy

···

On 10/05/2012 02:49 AM, Ryan May wrote:

On Thu, Oct 4, 2012 at 12:38 PM, Andreas Mueller > <amueller@...4089...> wrote:

On 10/04/2012 03:51 PM, Benjamin Root wrote:
On Thu, Oct 4, 2012 at 10:02 AM, Andreas Mueller <amueller@...4089...> >> wrote:

Hi everybody.
I have been trying to save some animations I made and I encountered the
problem mentioned here.
I am using current master.
To be precise, when I use
anim.save("file.mp4", fps=10, extra_args=['-vcodec', 'libx264'])
I get "RuntimeError: Error writing to file" from the agg backend.
If I don't use the extra_args, it works, but I get very, very bad
quality that can not be redeemed using bitrate.
I have ffmpeg and libx264 installed. I also tried the mencoder by passing
MencoderWriter() to save, but that resulted in a video where all frames
are identical.

Any help on this would be appreciated. Is there an easy way to just dump
the frames? I can do the mencoder bit myself.

Thanks,
Andy

Exactly which version of mpl are you using, and what is your platform? This
will help us diagnose what is going on.

Thanks for the quick answer.
I am not on the box but I used master from yesterday, so
89482b21c8582d49a2ddc2865e472eb404fd07e2, I guess.
The platform is Ubuntu Precise (with loads of random Python packages, but
that seems somewhat unrelated).

I'm on Ubuntu Precise (12.04) here as well. No problems with/without,
but I'm noticing the extra_args aren't being used (which I think is a
known bug I need to fix.) Can you run with --verbose-debug and post
the relevant output? (Or just compress and attach.)

Glad to hear it.

It would be nice if there were good docs, period. But that requires a
lazy dev (me) to finish his Ph.D. first. :slight_smile:

Ryan

···

On Fri, Oct 5, 2012 at 12:43 PM, Andreas Mueller <amueller@...4089...> wrote:

Thanks for the tip. I didn't know about ``--verbose-debug``.
It told me Unknown encoder 'libx264'.
I found out I need to install libavcodec-extra-53 for it to work.
Not everything is going smoothly.

It would be great if the docs could be updated with how to specify
a codec btw. I only found out by chance.

Thanks for your help, andy

--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma