Vizard 8 » Reference » Multimedia » Video basics
8.0

Video Basics

Vizard supports any video file for which your system has a codec. Within Vizard, videos combine functionality of both textures and  multimedia objects. So, you can add a video, apply it to a model or a texture quad, and play it. Vizard also has a plugin for capturing and recording video.

Adding and playing a video

Use viz.addVideo(<filename>) to load a video and then apply it to a 3D object using <node3d>.texture(<texture>) where <node3d> is the name of the 3D object and <texture> is the video that you've added. Now you can play, pause, loop, stop to your heart's desire (see the multimedia command table for all the  multimedia options).

object = viz.addTexQuad()
video = viz.addVideo('mona.mpg')
video.setRate(2)
object.texture(video)

Playing from specific locations in the file

If you want to play a video from a specific frame or time point, use <multimedia:av>.setFrame(<frame number>) or  <multimedia:av>.setTime(<second>).

object = viz.add('cylinder.wrl')
video = viz.addVideo('vizard.mpg')
object.texture(video)
video.setFrame(10)
video.play()

Videos with alpha channel (for "chroma-key" effects)

3rd party video editing software is capable of adding an alpha channel to a video file. These alpha channels are typically extracted from a chroma-key setup (e.g., green screening). If you have such a video, you can apply it to a texture quad and Vizard will correctly make the alpha transparency correct during rendering.

vid = viz.add('alpha.avi',loop=1,play=1)
quad = viz.addTexQuad(texture=vid)

Note: Previous releases of Vizard required that video files be resized so that the horizontal and vertical dimensions were power of two (e.g., 64, 128, 256, 512, etc.). This is no longer the case as Vizard now utilizes advanced features of OpenGL's more recent updates. Should you experience problems, you might try resizing. You can do this with a variety of tools; we recommend a free one called VirtualDub.

See also

In this section:

Multimedia basics

Sound basics -- The specifics of using sound files.

Recording sound -- Details about a Vizard module that allows you to record sound from a microphone.

Advanced 3D sound -- Details about a Vizard module that handles 3D sound.

Ambisonic 3D sound -- Details about the WorldViz Ambisonic sound system.

Multimedia command table -- A table of commands relevant to videos.

Other sections:

Tutorial: Multimedia -- A tutorial on using sound and video files.

Tutorial: 3D sound -- A tutorial on using Vizard's 3D sound capabilities.

Example scripts:

Video texture

Adding sounds

3D sound