Message Boards Message Boards

0
|
10071 Views
|
13 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Avi export - set time/speed

Posted 10 years ago

Still need help, I don't get it to work as expected:

vertices = 
  ParallelTable[
   Table[RotationTransform[a, {1, 1, 0}, {0, 0, 0}][
     Tuples[{-1, 1}, 3][[v]]], {v, 1, 8, 1}], {a, 0, 2 Pi, Pi/80}];

Edge := {1, 2, 4, 3, 7, 8, 6, 5, 1, 3, 4, 8, 7, 5, 6, 2}

CubeTrail[N_, s_, r_, z_, t_] := 
 Graphics[Table[
   Scale[Translate[{AbsoluteThickness[1.5], Opacity[1], White, 
      Line[Table[{vertices[[1 + Mod[t, 80]]][[Edge[[e]]]][[1]], 
         vertices[[1 + Mod[t, 80]]][[Edge[[e]]]][[2]]}, {e, 1, 16, 
         1}]]}, r*{Cos[2 Pi*(n*t/80 + k)/N], 
       Sin[2 Pi*(n*t/80 + k)/N]}], z^n, 
    r*{Cos[2 Pi*(n*t/80 + k)/N], Sin[2 Pi*(n*t/80 + k)/N]}], {k, 1, N,
     1}, {n, 1, s, 1}], PlotRange -> 5, ImageSize -> {1280, 720}, 
  Background -> RGBColor[54/255, 70/255, 93/255]]

Export[NotebookDirectory[] <> "movie.avi", 
 ParallelTable[CubeTrail[4, 8, 3.8, .75, n], {n, 1, 80}], 
 "FrameRate" -> 900, "VideoEncoding" -> Uncompressed]

Above is 'my' example, 900 frames - when I import that .avi in Magix Video, it has a max length of 3,08 seconds. More is not possible, whatever I do.

900 frames /25 fps=36.

Whats wrong there?

How to play that animation slower, it is too fast. Isn't there any way to set speed at export in mathematica directly?

If I do

Table[CubeTrail[4, 8, 3.8, .75, n], {n, 1, 160}]

and 600 fps, max length is 6,11...strange.

Any ideas what I do wrong or how to solve?

POSTED BY: Michael Steffen
13 Replies
Posted 10 years ago

In ParallelTable you generate 80 frames, then you are exporting at 900 frames per second. However, the corrected code below produces a really cool 36 second movie!

Export[NotebookDirectory[] <> "movie2.avi", 
 ParallelTable[CubeTrail[4, 8, 3.8, .75, n], {n, 1, 900}], 
 "FrameRate" -> 25, "VideoEncoding" -> Uncompressed]
POSTED BY: David Keith
Posted 10 years ago

No, thats not what I want - my goal is to let the animation run slower and smoother/more fluid.... Now the cubes do one rotation at 80, and what I want is that 160 for example is one rotation...but I think I got an idea, seems to me that I simply looked at the wrong location....I´ll try around now a bit, hopefully I got it.

POSTED BY: Michael Steffen

For a slow, smooth animation have you tried generating more intermediate frames?

Table[CubeTrail[4, 8, 3.8, .75, n], {n, 1, 160,1/4}]
POSTED BY: Gianluca Gorni
Posted 10 years ago

I haven't, but it seems that is what I am looking for :) I'll try around now a bit, many thanks already!

POSTED BY: Michael Steffen
Posted 10 years ago

This Table[CubeTrail[4, 8, 3.8, .75, n], {n, 1, 160,1/4}] does not work here, producing lots of errors and then the Pi is slowing down heavy until it freezes...

POSTED BY: Michael Steffen
Posted 10 years ago
  • he expression 9/4 cannot be used as a part specification.
  • Further output of Part::pkspec1 will be suppressed during this calculation.
  • Part specification 9/4[[1]] is longer than depth of object. ...

    Export[NotebookDirectory[] <> "movie.avi", ParallelTable[CubeTrail[4, 8, 3.8, .75, n], {n, 1, 160, 1/4}], "FrameRate" -> 25, "VideoEncoding" -> Uncompressed]

POSTED BY: Michael Steffen
Posted 10 years ago

Doublepost

POSTED BY: Michael Steffen

I thought your parameter t in CubeTrail was only in the rotation, but it also appears in the choice of vertices. Can you unlink the two meanings?

POSTED BY: Gianluca Gorni
Posted 10 years ago

No, as I do not really understand what happens there exactly for now. I found some animations and thought it maybe is possible to do some videos of them on the quick...seems it is not as easy as I have imagined^^

POSTED BY: Michael Steffen
Posted 10 years ago

Solved - I exchanged every '80' with 160, the 160 in the export-function with 320 (2 'rounds') - and now I have what I wanted - 12 seconds slow running, 300 frames, and it works.

(There is maybe another little flaw with line-length of the boxes, not sure, I need to watch it on pc first and try around a bit - but when I understand 'the way' I'll for sure get the rest perfect, too. (-> if line-length is really damaged, the reason could only be one of the 80/160-values))

POSTED BY: Michael Steffen

And how can I create a list of frames (or better: export to .avi) this one here:

Animate[Graphics[{White, 
Line[Table[{-.98^n*Sin[n*Pi/2], .98^n*Cos[n*Pi/2]}, {n, 0,  1000}]]}, PlotRange -> p, ImageSize -> {1280, 720}, 
Background -> Black], {p, .39, .37, .01}]

The easiest looking one but I do not get it...

Export[NotebookDirectory[] <> "The-Light.avi",  Table[Graphics[{White, 
Line[Table[{-.98^n*Sin[n*Pi/2], .98^n*Cos[n*Pi/2]}, {n, 0, 1000}]]}, PlotRange -> p, ImageSize -> {640, 360},Background -> Black], {p, .39, .37, .01}]]

does not work, same as my playarounds with ListAnimate....anyone a little hint for me how to create an avi from this?

POSTED BY: Michael Steffen

Hi Michael,

the problem simply seems to be that you are exporting an empty list:

Table[someFunction[p], {p, .39, .37, .01}]

You can not go from .39 to .37 with a positive stepsize .01; is must read:

Table[someFunction[p], {p, .39, .37, -.01}]

Animate and Manipulate are more tolerant in this respect, but not Table.

Regards -- Henrik

POSTED BY: Henrik Schachner

This was irritating me, too - but simply set step to negative did not came to my mind....works like a charm now, many thanks! Hours of playing around, and a simple - solves it :D

POSTED BY: Michael Steffen
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract