andrewRowlinson / mplsoccer

Football pitch plotting library for matplotlib
MIT License
391 stars 80 forks source link

How to create a video from images? #59

Open pakkk opened 2 years ago

pakkk commented 2 years ago

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.

andrewRowlinson commented 2 years ago

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

pakkk commented 2 years ago

Thanks Andrew,

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

Cheers, Paco.