VideoGenerator
VideoGenerator[model]
generates one second of video of a given model.
VideoGenerator[model,t]
generates t seconds of video.
Details and Options



- VideoGenerator can be used to generate video objects algorithmically. It is typically used for creating video of a time-varying plot, a rotating 3D object, etc.
- Possible settings for model include:
-
imagespec model to create images for the video track <"Image"imagespec,"Audio"audiospec > models to create images and audio samples for video and audio tracks - The imagespec can be any of the following:
-
image uses image in the first track {image1,image2,…} uses the sequence of imagei in the first track {{im11,im12,…},{im21,im22,…},…} uses the sequence of {imi1,imi2,…} in the track
imagefunc a function imagefunc that creates one or multiple images - When using VideoGenerator[imagefunc,…], if imagefunc returns a list of images, the image at position i is assumed to be the frame for the
video track.
- The audiospec can be any of the following:
-
audio uses audio in the first track {audio1,audio2,…} uses the sequence of audioi in the first track {{a11,a12,…},{a21,a22,…},…} uses the sequence of {ai1,ai2,…} in the track
audiofunc a function audiofunc that creates a list or matrix of audio samples - If audiofunc returns a matrix of audio values, the list at position i is assumed to be the data for the
audio track.
- The time specification t can be given as a scalar specifying the time in seconds or a time Quantity object:
-
t time given in seconds Quantity[t,"unit"] time given in "unit" compatible with seconds Quantity[t,"Frames"] time given as a number of frames - To generate frames in parallel, use Parallelize[VideoGenerator[…]]. »
- The following options are supported:
-
AudioEncoding Automatic audio encoding to use CompressionLevel Automatic compression level to use FrameRate Automatic the frame rate to use GeneratedAssetLocation $GeneratedAssetLocation the location of the result OverwriteTarget False whether to overwrite an existing file RasterSize Automatic the raster size used to rasterize expressions SampleRate Automatic the audio sample rate to use VideoEncoding Automatic video encoding to use
Examples
open allclose allScope (8)
Create a two-second-long video from a single image:
Show a few frames of the generated video:
Specify the number of frames to generate:
Verify the number of frames in the result:
Create a video from a list of images:
Show time series of frame color values:
Create a video from a rotating image:
Show a few frames of the generated video:
Create a video with an audio track:
Use a function to generate frames:
The function takes the time as input and rasterizes it to an Image:
Use functions to generate both the video and audio tracks:
The image function takes the time as input and rasterizes it to an Image:
The audio function takes the time as input and uses it to control the frequency of a triangle wave:
Use a function to generate two video tracks:
The function generates blurred frames in the first track with increasing radius:
The function generates quantized images with increasing colors in the second track:
Options (10)
AudioEncoding (1)
Use the AudioEncoding option to specify the audio encoding to be used:
CompressionLevel (1)
Use the CompressionLevel option to control the file size of the result:
GeneratedAssetLocation (2)
Assets are automatically generated in the "Video" folder within $WolframDocumentsDirectory:
Specify the location of the asset created by VideoGenerator:
Use a LocalObject as the asset for the resulting Video object:
OverwriteTarget (1)
By default, if a file already exists it is not overwritten:

Overwrite an existing file by specifying OverwriteTargetTrue:
RasterSize (1)
By default, if the video tracks specification produces a Graphics object, the result is rasterized:
Use the RasterSize option to control the rasterization:
If the video tracks specification produces an Image, specifying the RasterSize option will resize the result:
SampleRate (2)
By default, if the audio tracks specification is an Audio object, the sample rate will be preserved:
Use the SampleRate option to resample the audio input:
If the audio tracks specification is a function, the default sample is Hz:
Use the SampleRate option to control the sample rate of the result:
VideoEncoding (1)
Use the VideoEncoding option to specify the video encoding to be used:
Applications (5)
Create a video by adding a still image to an audio signal:
Generate a video by moving the viewpoint around a 3D object:
Visualize the viewpoint trajectory:
Generate the Video:
Create a Video object displaying the evolution of a cellular automaton:
Create a Video object displaying a ball bouncing down steps.
First, solve the differential equation governing the motion of the ball:
Precompute a "staircase" background:
Display the evolution of the ball's position over the staircase:
Create a video showing the travel directions from Champaign to Chicago:
Properties & Relations (3)
Parallelize an expensive frame generation to speed up the computation:
Use Animate to create an animation in a notebook:
VideoGenerator can achieve the same results but without displaying any controls:
The result is also more easily shareable outside a notebook, since it creates a video file.
Separately generated video and audio objects can be combined using VideoCombine.
Generate a video with no audio:
Combine the two using VideoCombine:
Text
Wolfram Research (2020), VideoGenerator, Wolfram Language function, https://reference.wolfram.com/language/ref/VideoGenerator.html.
BibTeX
BibLaTeX
CMS
Wolfram Language. 2020. "VideoGenerator." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/VideoGenerator.html.
APA
Wolfram Language. (2020). VideoGenerator. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/VideoGenerator.html