Animation saving via ffmpeg stops after some 300 frames #10729
Saving an animation with 1000 frames to a mp4 file via the ffmpeg writer fails on matplotlib 2.2. Instead of the desired 1000 frames, only some 300 frames are saved, then the process stops.
Code for reproduction
The following is the example code from basic_example_writer, with the number of frames modified to 1000.
In matplotlib 2.2 this code prints the numbers up to some endnumber of around 290. Then nothing happens - i.e. the process does not finish, just halts. There is a mp4 file created which shows those first 290 frames correctly (0:20 min long video). This file is created after the running process is manually termined.
In matplotlib 2.1 the code produces an mp4 file with 1000 frames (i.e. a 1:06 min long video) as expected.
They are the same in both cases.
The actual number of frames produces varies. It is depending on the bitrate. 5 successive runs produce
This issue has been brought up in this SO post. In that case the example uses images and the maximal number of frames is again different from this example here.
Looks like the culprit is at https://github.com/matplotlib/matplotlib/blob/v2.2.x/lib/matplotlib/animation.py#L673. Logging is not quieted because