Message Boards Message Boards

12 Replies
0 Total Likes
View groups...
Share this post:

How to create a video without border, buttons and slider?

Posted 9 years ago

Hello, I am a total newbie here and in Mathematica and trying to create some videos in 1080p with it. My problem is - how do I remove the borders and buttons for output?

If I try

vertices = 
   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_] := 
   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 -> 700, 
  Background -> RGBColor[54/255, 70/255, 93/255]]

Animate[CubeTrail[4, 8, 3.8, .75, t], {t, 1, 80, 1}, 
  Paneled -> 
   False] /. (AppearanceElements -> _) -> (AppearanceElements -> {})

for example, I still have the var t shown above the animation...can someone tell me pls what I can do to remove that letter in this example here?

Is there another, better way to create videos without any buttons and borders around it?

Or this here:

   Table[{EdgeForm[{Black, AbsoluteThickness[2.5]}], FaceForm[White], 
      Polygon[Table[{{3.9 Sin[Pi/8 (t + V)] + 
           i/8 ((-1)^S*(1 + Abs[3.9 Sin[Pi/8 (t + V)]]) - 
              3.9 Sin[Pi/8 (t + V)]), 
          i/8}, {-3.9 Sin[Pi/8 (t + V)] + 
           i/8 ((-1)^S*(1 + Abs[3.9 Sin[Pi/8 (t + V)]]) + 
              3.9 Sin[Pi/8 (t + V)]), 
          2 - i/8}, {(-1)^S*6 - (-1)^S*i/8, 
          2 - i/8}, {(-1)^S*6 - (-1)^S*i/8, i/8}}, {i, 0, 8, 
         1}]], {0, -2 V}]}, {S, 0, 1}], {V, 0, 7, 1}], 
  ImageSize -> 500], {t, 0, 16}]

When I run, there is a slider shown ('t') which moves the anim, when I understand it right, t is the variable which slides through 0 and 16, is that correct? How do i need to change the code, that it does this automatically when I run it? (without border, slider or any button)

POSTED BY: Michael Steffen
12 Replies

You can make the list of frames Table[CubeTrail[4, 8, 3.8, .75, n], {n,1,80}] and then export it to a video.

Need more help: can you explain me please, why you exchanged 't' in this example with 'n'? Why the 'n', what does n in that code?

At the moment I try do to the same with this one here

WfPlot[s_, w_, t_] := 
     Line[Table[{i + 
         If[Mod[i, 2] == 0, s*Sin[j*2 Pi/w + i*2 Pi/6 + t], 
          0], (-1)^i*.5 + .4*j}, {i, -2, 15}]]}, {j, 1, 69, 1}], 
   PlotRange -> {{1, 20}, {.8, 27.2}}, ImageSize -> {1000, 1000}, 
   Background -> RGBColor[54/255, 70/255, 93/255]];

LogPolar[x_, y_] := {Log[Sqrt[x^2 + y^2]], ArcTan[x, y]};

p := {{66, .2}, {6, .3}, {11, .4}}

  ImageTransformation[WfPlot[p[[k, 1]], p[[k, 2]], t], 
   LogPolar[#[[1]], #[[2]]] &, DataRange -> {{-Pi, Pi}, {-Pi, Pi}}], 
  700], {k, 1, 3, 1}, {t, 0, 2 Pi}]

but do not really understand why you exchanged the var 't' with 'n' in the other example...beside that, this one here has 2 variables, k and t - how can I give 'k' a constant value (maybe 2), and do a 'table-export' like in the first example?

POSTED BY: Michael Steffen

(edit: question removed and put to the bottom of this topic)

POSTED BY: Michael Steffen

Tonight I got a working .avi - but I forgot how, I think the setting was 160x120 with 50fps. Minutes ago I did another test with 800x600 and 600fps, it again does not play on Pi or Pc. I tried to edit it with my videoeditor and stretch it to 6 seconds - it worked, but not perfect. I don't know why, but if I stretched it to 6 seconds, the fps goes to 25,?? (not 25.00), and if I set it to 25fps, I got a vid of 6,09 seconds...a bit weird, I need to investigate that a bit more.

Is there maybe a way to set the length for this animation (for . avi) in mathematica?

(Edit: Speed and length are solved here)

POSTED BY: Michael Steffen

I don't know how to do it in Mathematica, but I can adjust the frame rate of a gif animation with an external program. In my case I use GraphicConverter for Macintosh.

POSTED BY: Gianluca Gorni

I was too fast...I am using a RaspberryPi and the VLC-Player does not play the .avi, I'll try on another Pc, maybe its codec-related, I am not sure, but the Omxplayer also don't play.

Actually I try

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

if I try .gif, that file works - but without any change in framerate, whichever value I enter. Is there a good way to change the framerate for the .gif-format in this example? Or do I something wrong?

Edit: The .avi works on a win-pc - but is 70mb (!) large (640x480 / 100fps) and runs to end in ~1 second...way too fast. Maybe I need to fiddle around a bit more with it, but the .gif-solution worked better - but how to change framerate for that way?

POSTED BY: Michael Steffen

Seems to work, great.

Now I am going to try everything on some other animations...really interesting program.

POSTED BY: Michael Steffen

You can adjust the frame rate this way:

Export[NotebookDirectory[] <> "movie.avi", 
 Table[Graphics[Point[{Cos[t], Sin[t]}], PlotRange -> 2], {t, 0, 2 Pi,
    Pi/40}], "FrameRate" -> 25]
POSTED BY: Gianluca Gorni

Works well (after I found out that .avi is not possible with this table, but .gif is fine), thanks.

But what I still not understand is how to change the framerate of this animation for a smoother have any hints for this, too? :)

POSTED BY: Michael Steffen

You can make the list of frames

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

and then export it to a video.

POSTED BY: Gianluca Gorni

And is there an easy way to export such a dynamic animaton? If I try

m = Dynamic[CubeTrail[4, 8, 3.8, .75, Clock[{1, 80, 1}, 10]]]
Export ["test.avi", m]

"test.avi", %, it tells me

Export::errelem: The Export element GraphicsList contains a malformed data structure and could not be exported to AVI format.

POSTED BY: Michael Steffen

Cool, I'll need to play around with it a bit - but it seems to work, many thanks

POSTED BY: Michael Steffen

An attempt with Dynamic:

Dynamic[CubeTrail[4, 8, 3.8, .75, Clock[{1, 80, 1}, 20]]]
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract