i $(seq.stitle)-palette.png -lavfi paletteuse -y /tmp/$(seq.stitle).gif`) Run(`ffmpeg -framerate 30 -f image2 -i $(tempdirectory)/%10d.png Inside animate(), the first pass creates a GIF color palette, the second builds the file: run(`ffmpeg -f image2 -i $(tempdirectory)/%10d.png -vf palettegen The creategif option for the animate function makes an attempt at running ffmpeg and assumes that it's already installed.
#LUXOR 2 DEMO HOW TO#
Making the animationįor best results, you'll have to learn how to use something like ffmpeg, with its hundreds of options, which include codec selection, framerate adjustment and color palette tweaking.
#LUXOR 2 DEMO MOVIE#
The second scene, calling the frame() function, shows how you can pass optional information to the function.Īnimate(movie::Movie, scene::Scene creategif=false, framerate=30)Ĭreate the movie defined in movie by rendering the frames define in scene. The finish() function is automatically called when all the drawing functions in the scenes have completed, and the process starts afresh for the next frame. A drawing is automatically created (in PNG format) and centered ( origin()) so you can start drawing immediately. For each frame numbered 0 to 359, the graphics are drawn by both the backdrop() and frame() functions, in that order. In this example, the movie uses two scenes, each specifying a function to draw frames from 0 to 359. Text(string("frame $framenumber of $()"),
Optionally, you can ask for ffmpeg (if it's installed) to make an animated GIF for you. This creates all the frames and saves them in a temporary directory. There are four steps to creating an animation.ġ Use Movie to create a Movie object which determines the title and dimensions.Ģ Define some functions that draw the graphics for specific frames.ģ Define one or more Scenes that call these functions for specific frames.Ĥ Call the animate(movie::Movie, scenes) function, passing in the scenes. Luxor provides some functions to help you create animations-at least, it provides some assistance in creating lots of individual frames that can later be stitched together to form a moving animation, such as a GIF or MP4.