Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to make a exportable film (in some format like .avi or .mp4, something playable on most computers) where each frame is a Graphics3D output. For example, we might generate frames in the following way:

polytopeSize = 3;

numFrames = 10;  
frameSet = Table[Graphics3D[Table[Translate[Scale[PolyhedronData["Dodecahedron", "Faces"], polytopeSize], RandomReal[{0, 5}, 3]], {i, 1, 5}]], {k, 1, numFrames}];

I'd like to be able to set a time delay individually for each frame:

frameSetTimeDelaysInSeconds = RandomReal[{0,1}, numFrames];

Is this possible?

share|improve this question
See this question for a solution for non-GIF files. – cormullion Nov 11 '13 at 11:24

Here's an idea that could be worth exploring:

table = Flatten[
    Table[#1, {Round@#2}] &, {frameSet, 30 * frameSetTimeDelaysInSeconds}]];

Export["", table]

This just duplicates frames for as many times as necessary - inelegant, I suppose, but it might do.

share|improve this answer

The hyperlink from cormullion is cormullion is ideal.

A table of "DisplayDurations" can be used for animated gifs.

AVI's tend to be very large and you can use other software to compress. MOV/QT files are reasonable.

Here is away to have variable frame durations by padding frames:

framerate = 15;
framnum = Round[framerate frameSetTimeDelaysInSeconds]
film = Join @@ MapThread[Table[#1, {#2}] &, {frameSet, framnum}];

You can then export:

Export["yourfilename.avi", film,"FrameRate" -> framerate]

This will be a large file.

For quicktime:

Export["", film,  "FrameRate" -> framerate]

I note the default frame rate for quicktime is 15fps...I just illustrate potential to change (play with).

An example is here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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