#11170: add an ffmpeg option to the animate command
-----------------------------+----------------------------------------------
   Reporter:  jhpalmieri     |       Owner:  jason, was  
       Type:  enhancement    |      Status:  needs_review
   Priority:  minor          |   Milestone:  sage-4.7.1  
  Component:  graphics       |    Keywords:              
     Author:  John Palmieri  |    Upstream:  N/A         
   Reviewer:                 |      Merged:              
Work_issues:                 |  
-----------------------------+----------------------------------------------

Old description:

> The attached patch allows you to do this:
> {{{
> sage: a = animate(a = animate([sin(x + float(k)) for k in
> srange(0,2*pi,0.7)])
> sage: a.ffmpeg('output.mpg')
> }}}
> or
> {{{
> sage: a.ffmpeg('output.avi')
> }}}
> Also, calling
> {{{
> sage: a.save('output.mpg')  # or a.save('output.avi')
> }}}
> for example will work, calling the ffmpeg method.  If ffmpeg is
> installed, it is also used to construct animated gifs, since it's faster
> than convert.
>
> There was some discussion of this here:
> [https://groups.google.com/d/topic/sage-support/TdQ29S32K9k/discussion].
>
> This also clean up some doctest flags, using {{{# optional --
> ImageMagick}}} and {{{# optional -- ffmpeg}}} to mark the appropriate
> tests.  For me, tests pass with each of the following combinations, and
> there are no stray graphics files created:
> {{{
> sage -t -long -optional animate.py    (with convert and ffmpeg installed)
> sage -t -long -only-optional=imagemagick (with only convert installed)
> sage -t -long -only-optional=ffmpeg (with only ffmpeg installed)
> sage -t -long
> }}}

New description:

 The attached patch allows you to do this:
 {{{
 sage: a = animate([sin(x + float(k)) for k in srange(0,2*pi,0.7)])
 sage: a.ffmpeg('output.mpg')
 }}}
 or
 {{{
 sage: a.ffmpeg('output.avi')
 }}}
 Also, calling
 {{{
 sage: a.save('output.mpg')  # or a.save('output.avi')
 }}}
 for example will work, calling the ffmpeg method.  If ffmpeg is installed,
 it is also used to construct animated gifs, since it's faster than
 convert.

 There was some discussion of this here: [https://groups.google.com/d/topic
 /sage-support/TdQ29S32K9k/discussion].

 This also clean up some doctest flags, using {{{# optional --
 ImageMagick}}} and {{{# optional -- ffmpeg}}} to mark the appropriate
 tests.  For me, tests pass with each of the following combinations, and
 there are no stray graphics files created:
 {{{
 sage -t -long -optional animate.py    (with convert and ffmpeg installed)
 sage -t -long -only-optional=imagemagick (with only convert installed)
 sage -t -long -only-optional=ffmpeg (with only ffmpeg installed)
 sage -t -long
 }}}

--

Comment(by niles):

 Nice!  Here are a few things I noticed in the patch:

 line 334: "neither ffmpeg or ImageMagick is not installed...": needs to be
 cleaned up

 line 458: "Returns an mpeg showing...": this is from the docstring for
 .ffmpeg -- should it be reworded to include other video formats?

 line 527: "saving an animation to an mpg file..." : this error message is
 shown even if another format is chosen -- could be confusing if a user
 misunderstands and thinks that mpg format is the underlying problem.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11170#comment:4>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to