3
$\begingroup$

I want to export an animation,

anim = Animate[Plot[Sin[x + a], {x, 0, 10}], {a, 0, 5}, AnimationRepetitions -> 1, AnimationDirection -> Forward]

then export it

Export["animation.gif", anim]

the outputs loops. $a$ runs from $0 \to 5$ and then from $5 \to 0$ when I explicitly instructed that it should only repeat once and only go forward. I've tried other output file formats and all of them looped.

Appreciate any help.

$\endgroup$

2 Answers 2

5
$\begingroup$

Add Bookmarks:

   anim = Animate[Plot[Sin[x + a], {x, 0, 10}], {a, 0, 5}, 
          Bookmarks -> {"start" :> {a = 0}, "stop" :> {a = 5}}];
   Export["animation.gif", anim]
$\endgroup$
2
  • $\begingroup$ I tried to increase the animations length with DefaultDuration -> 10. The output from Mathematica respects the command but the exported ogv is always around 3 secs, with or without the Bookmark. Here [reference.wolfram.com/language/guide/MultimediaFormats.html] it suggests the use of "Duration" in the Export symbol but I tried adding it as a parameter in Export but it doesn't work. Any thoughts? $\endgroup$ Commented Jun 22, 2020 at 21:11
  • 1
    $\begingroup$ @ vozdrugíja Try Export["animation.ogv", anim,"AnimationDuration" -> 15], 15 being 15 secs. $\endgroup$
    – Rupesh
    Commented Jun 22, 2020 at 21:31
0
$\begingroup$

This function (Export) seems buggy, at least when Animation is its object. I prefer using "simplescreenrecorder" program when in Linux. I run the animation in Mathematica and capture the interesting part of the screen with ssr.
Et voilà !

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.