24
$\begingroup$

I am exporting an animation created using Manipulate in the .avi format. However the video runs very fast (I am putting it in Keynote). Its speed seems independent of how small I choose the step in Manipulate. Is there a way to control how fast the .avi will run or some other way to show the animation slower?

$\endgroup$
2

4 Answers 4

27
$\begingroup$

The trick is using a combination of "FrameRate", an option of Export, and AutorunSequencing, an option of Manipulate. The former determines the number of frames/second of the movie whereas the latter determines how long a sweep of the control takes. With one control, that will be the length of the movie.

Export["output.avi", 
 Manipulate[
   Plot[Sin[k  x], {x, 0, 2 \[Pi]}], 
   {k, 1, 5}, 
   AutorunSequencing -> {{1, 10}}
 ], "FrameRate" -> 2
]

enter image description here

$\endgroup$
3
  • 1
    $\begingroup$ Actually the FrameRate will not control the speed of sliderbar's velocity.Just take frame form oringnal fast video. $\endgroup$
    – yode
    Oct 15, 2015 at 2:57
  • $\begingroup$ I don't think you read my post correctly. $\endgroup$ Oct 15, 2015 at 5:54
  • 1
    $\begingroup$ What happens when I need FrameRate to be 0.5? To have a picture for 2seconds for example? I did not work for me. $\endgroup$ Aug 31, 2018 at 2:28
9
$\begingroup$

The option you need is "FrameRate". It's not even necessary to create a list of graphics objects first, as per Sjored's answer.

$\endgroup$
5
  • $\begingroup$ You can Export a Manipulate as movie without creating an array. Try Export["output.avi", Manipulate[Plot[Sin[k x], {x, 0, 2 \[Pi]}], {k, 1, 5}]] $\endgroup$ May 14, 2012 at 19:44
  • $\begingroup$ @SjoerdC.deVries: but you can't control the speed of the movie that way afaik. $\endgroup$
    – Heike
    May 14, 2012 at 19:46
  • $\begingroup$ @heike please see my answer $\endgroup$ May 14, 2012 at 20:06
  • $\begingroup$ @SjoerdC.deVries I stand corrected $\endgroup$
    – Heike
    May 14, 2012 at 20:21
  • $\begingroup$ @SjoerdC.deVries Me too:) $\endgroup$
    – Ajasja
    May 14, 2012 at 20:30
5
$\begingroup$

I've found that giving the option "AnimationDuration"-> (seconds) in the Export function gives better results generally.

$\endgroup$
3
  • 1
    $\begingroup$ Please elaborate on your answer. For instance, in what sense does "AnimationDuration" give better results? $\endgroup$
    – bbgodfrey
    Oct 14, 2015 at 14:50
  • $\begingroup$ @bbgodfrey Rather than reducing the framerate, it gives a longer animation at the same framretae, making it smoother. $\endgroup$ Oct 16, 2015 at 8:38
  • $\begingroup$ I don't see this as an options at all $\endgroup$
    – soandos
    Nov 24, 2016 at 17:31
0
$\begingroup$

You can use AnimationDuration to control this and a good FrameRate to make the transition smoother.

Export["output.avi", 
 Manipulate[Plot[Sin[k x], {x, 0, 2 \[Pi]}], {k, 1, 5}, 
  AutorunSequencing -> {{1, 10}}], "FrameRate" -> 25, 
 "AnimationDuration" -> 15]

Video in: Animation Video

$\endgroup$
1
  • $\begingroup$ Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center. $\endgroup$
    – Community Bot
    Mar 15 at 1:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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