-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
animation with 'ffmpeg' backend and 'savefig.bbox = tight' garbles video #6416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I can reproduce the fps issue here locally on OSX on python 3.4, matplotlib 1.5.1. Not sure why |
It might be worth using an rccontext in This is an awfully large foot-cannon to have very lightly documented. |
That's a really good idea--I'll go ahead and include that when I put up a PR to fix the fps issue. |
Ok, so there are really two things that are different cases that we haven't hit before:
In the meanwhile, the work-around/intended use would be to do: mywriter = animation.FFMpegWriter(fps=30, extra_args=['-vcodec', 'libx264']) and anim.save(movie_file, dpi=100, writer=mywriter) Clearly, since I had to actually dig into this problem, it's not intuitive; I'm just not sure what the right answer is. |
This fixes part of matplotlib#6416 by resetting the 'savefig.bbox' rcParam if it is set to 'tight'.
The workaround works for me (for the fps issue) - thanx for the explanation and the quick solution! For debugging purposes, it would be great to see messages created by the actual movie writer (ffmpeg in my case): An invalid parameter in the |
This fixes part of matplotlib#6416 by resetting the 'savefig.bbox' rcParam if it is set to 'tight'.
Having given this some thought, I think the right solution is to document the kwargs which will have no effect when Anyone else have any thoughts? |
No one reads warnings 👿. I lean towards |
|
I tend to view that as ok, it is just telling users that code that wasn't working really isn't working. |
Animation error handling (Fixes #6416)
This fixes part of matplotlib#6416 by resetting the 'savefig.bbox' rcParam if it is set to 'tight'.
Using
animation with 'ffmpeg' backend incompative with 'bounding_box=tight' #2483 seems to be back (or still there):
Setting
savefig.bbox = tight
either in matplotlibrc or as an rcParam garbles an mp4 video written by ffmpeg. Even starting the script with --verbose-debug gives no warning or message that something might be wrong.I also cannot change the frame rate - neither
interval
norfps
has any effect, I always get 5 fps (this is consistent with the options passed to ffmpeg which always says '-r 5').Example (slightly modded) taken from
https://jakevdp.github.io/blog/2012/08/18/matplotlib-animation-tutorial/ :
The text was updated successfully, but these errors were encountered: