mplsoccer icon indicating copy to clipboard operation
mplsoccer copied to clipboard

How to create a video from images?

Open pakkk opened this issue 2 years ago • 2 comments

Hi Andrew,

I am trying to create a video with your sample code (plot_animation.py):

anim.save('example.mp4', dpi=150, fps=25, extra_args=['-vcodec', 'libx264'], savefig_kwargs={'pad_inches':0, 'facecolor':'#457E29'})

As you advanced in your comments, I had problems to download ffmpeg (in this case, using brew), so I found this web site to download the static executable:

https://evermeet.cx/ffmpeg/

After that, my code can generate the video with the previous code, but there are too many overlapping between every animation (the image 1 contains the figures of the image 0, the image 2 contains the figures of the image 1, etcetera)

Do you know how to solve that?

Thank you.

pakkk avatar Jul 26 '22 08:07 pakkk

I'm not sure how to do it without Anaconda, but there is an alternative for creating gifs: https://github.com/maxhumber/gif

andrewRowlinson avatar Jul 28 '22 18:07 andrewRowlinson

Thanks Andrew,

When you say "without Anaconda", do you say that you achieved a mp4 representation without overlapping?

Cheers, Paco.

pakkk avatar Jul 31 '22 08:07 pakkk