#12827: Expand Animation class to accept more graphics types
-------------------------------------+-------------------------------------
Reporter: niles | Owner: jason, was
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.1
Component: graphics | Resolution:
Keywords: animate, | Merged in:
graphics, 3D | Reviewers:
Authors: Niles Johnson | Work issues: docstrings, testing,
Report Upstream: N/A | think about img protocol
Branch: | Commit:
u/niles/ticket/12827 | 3561ef7ea858e344a1ae25b071e1077f6f41927a
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by niles):
I've tested this now on two (recent) versions of ffmpeg. Here is the
output of `ffmpeg -version`:
(A)
{{{
ffmpeg version 1.2.2
built on Jul 29 2013 08:29:33 with Apple clang version 4.1
(tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)
}}}
(B)
{{{
ffmpeg version git-2013-06-29-53fd1ab
built on Jun 28 2013 23:41:23 with gcc 4.4.7 (GCC) 20120313 (Red Hat
4.4.7-3)
}}}
Replying to [comment:19 jhpalmieri]:
> Second, a typo: on the third line of `animate.py`, "iteratable" should
be "iterable".
fixed now
----
> - the `-loop_output` flag
It seems that this change occurred in summer 2011, appearing in ffmpeg
version 0.9 -- here's the
[https://github.com/FFmpeg/FFmpeg/commit/f5302e5dcf6572e9424d51d152bffc570cd75ce6
commit on github]. I'm not sure of the best course, but the ffmpeg
developers didn't make the change backward-compatible so I'm inclined to
do the same and blame them. Checking the ffmpeg version is annoying
because it can be a number like `1.2.2` or a string like
`git-2013-06-29-53fd1ab`. Who knows if there are yet other ways that
ffmpeg reports its version. My current best idea is to just add a note
about version 0.9 or higher in the documentation -- I'll do that in the
next commit.
----
> - the `-g 3` option
I get no error with or without this option on my ffmpeg version (A), but
do get the error with this option on version (B). After some googling, it
seems that this option controls the number of frames between keyframes,
which is useful to adjust for streaming video. Seems like this is not
important enough to include as a default setting in sage, so I've dropped
it in the previous commit.
----
> - the `-pix_fmt rgb24` option
Note that this option is applied by sage only for gifs. For my version
(A), I have no warning message at all. For (B) I have a similar warning
message to yours, but it says "auto-selecting format 'rgb8'". The ffmpeg
documentation (for what it's worth) says that ffmpeg will automatically
choose a new value if the given one is not available (implying that it
will not raise an error, only a warning).
Importantly, my version (A), but not (B), raises an error if this value is
not set. It seemed like the best course of action would add this as an
argument to `Animate.ffmpeg` so that it can have a reasonable default
value but be easily adjusted depending on the installation. I've done
this in the previous commit.
----
> - the gif file produced by ffmpeg
The examples I produce with version (A) look pretty good to me, but the
ones produced with (B) are bad as you describe (the rotating ellipses
example is worse; parts of the ellipses change color and disappear as they
rotate). I don't know what to do about this though. Increasing the
thickness of the plotted curves helped substantially, but the output was
still not great. It's possible there are some ffmpeg options which could
improve things, but I haven't been able to find them.
--
Ticket URL: <http://trac.sagemath.org/ticket/12827#comment:22>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.