Ask Your Question
1

Update animate.py for gif creation using ffmpeg

asked 2013-08-22 06:15:42 -0500

jazz gravatar image

updated 2015-01-14 07:36:39 -0500

FrédéricC gravatar image

As I tried to run Animated plots -- Sage Reference Manual v5.11: 2D Graphics and there the example

a = animate([sin(x + float(k)) for k in srange(0,2*pi,0.7)],
               xmin=0, xmax=2*pi, figsize=[2,1])
dir = tmp_dir()
#a.ffmpeg(savefile=dir + 'new.mpg')       # optional -- ffmpeg
#a.ffmpeg(savefile=dir + 'new.avi')       # optional -- ffmpeg
a.ffmpeg(savefile=dir + 'new.gif')       # optional -- ffmpeg
#a.ffmpeg(savefile=dir + 'new.mpg', show_path=True) # optional -- ffmpeg

there appeared an error on the gif creation. Thus using the option verbose = true. There the error was explained to appear in
/Applications/Sage-5.11-OSX-64bit-10.6.app/Contents/Resources/sage/devel/sage-main/build/sage/plot/animate.py in line 570. There the line is

ffmpeg_options += ' -pix_fmt rgb24 -loop_output %s ' % iterations

where the option -loop_output should be changed to -loop as I did since ffmpeg states "This option is deprecated, use -loop". Then the creation of a gif file worked with my version of ffmpeg: 1.2.1, using the ffmpeg command but the file is still of minor quality compared to e.g. mp4.

So perhaps somebody of the staff team can change the animate.py file for future versions. I know that it should be done by a ticket but as a newbee I'm not familiar in making up a ticket. Thanks

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2013-08-22 06:21:11 -0500

ppurka gravatar image

Thanks for the report. This is now ticket 15081.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-08-22 06:15:42 -0500

Seen: 87 times

Last updated: Aug 22 '13