I would like smooth animation of a sequence of images, without the controls displayed by ListAnimate. I have a very simple playback function

ShowMovie[movie_, framerate_] := 
 Dynamic[movie[[Clock[{1, Length[movie], 1}, 
     Length[movie]/framerate]]], UpdateInterval -> 0]

But compared to ListAnimate, the animation is very jerky. This is illustrated in the following demonstration, which shows a square varied sinusoidally in luminance at various frequencies. ListAnimate is quite smooth, while ShowMovie is not. This is especially evident at the higher frequencies.

framerate = 60;
  frames = If[hz == 0, 1, Ceiling[framerate/hz]];
  contrasts = Sin[2. Pi Range[frames]/frames];
  movie = 
   Image[{{#}}, Magnification -> 128] & /@ (.5 + .5 contrasts);
  method[movie, framerate]
 , {{hz, 1, "Hz"}, {0, 1, 2, 4, 10, 15, 20, 30}, 
  ControlType -> SetterBar}
 , {method, {ShowMovie, ListAnimate}}

Any suggestions on how to obtain smooth playback?

(This is related to an earlier question of mine but I hope is considered new.)

  • $\begingroup$ Related Q/A: Why animator smoothes dynamic updates. $\endgroup$ – Silvia Nov 2 '14 at 6:45
  • $\begingroup$ It is remarkable that after all this time Mathematica has no native "Movie" object, in the same way that it has an "Image" object. $\endgroup$ – abwatson Nov 3 '14 at 2:07

Your Answer

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

Browse other questions tagged or ask your own question.