Skip to content

Commit

Permalink
Removing support for GIF animation on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
safreita1 committed Aug 24, 2022
1 parent c219e78 commit 1cc2c19
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions graph_tiger/simulations.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,12 +291,15 @@ def update(step):
interval = 20
fps = 1

anim = animation.FuncAnimation(fig, update, frames=frames, interval=interval, blit=not self.prm['gif_snaps'], repeat=False)
writer = animation.FFMpegWriter(fps=fps, extra_args=['-vcodec', 'libx264'])
if platform.system() != 'Windows':
anim = animation.FuncAnimation(fig, update, frames=frames, interval=interval, blit=not self.prm['gif_snaps'], repeat=False)
writer = animation.FFMpegWriter(fps=fps, extra_args=['-vcodec', 'libx264'])

title = self.get_plot_title(self.prm['steps'])
gif_path = os.path.join(self.save_dir, title + '.mp4')
anim.save(gif_path, writer=writer)
title = self.get_plot_title(self.prm['steps'])
gif_path = os.path.join(self.save_dir, title + '.mp4')
anim.save(gif_path, writer=writer)
else:
print('Warning: Animated video functionality not supported on Windows; snapshot images are available.')

plt.clf()

Expand Down

0 comments on commit 1cc2c19

Please sign in to comment.