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$

1 Answer 1

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$ Jun 22, 2020 at 21:11
  • 1
    $\begingroup$ @ vozdrugíja Try Export["animation.ogv", anim,"AnimationDuration" -> 15], 15 being 15 secs. $\endgroup$
    – Rupesh
    Jun 22, 2020 at 21:31

Your Answer

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

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