Module: Movie Player ()
This module allows you to play back a sequence of single images, a movie. These images can be stored as separate files in a 2D image format supported by (for example JPEG, TIFF, PNG, or PPM) or they may packed together in one or more movie data files (moviename.amovstream). To create movies using , use the Movie Maker.
The Movie Format
This module is capable of playing back a sequence of images. This sequence is loaded from one or more so-called streams. Each stream consists of an image sequence. During playback this module retrieves images from all streams and meshes them together for the final image sequence which gets then rendered to the screen. Imagine there are N streams. The first image comes from the first stream, image 2 from stream 2, image N from stream N, image N+1 again from stream 1, image N+2 from stream 2 and so on. (Expert note: this behavior can be changed by editing the movie info file). After specifying the streams, the module needs to know what type of movie this image sequence forms, e.g., mono, stereo, stereo interlaced and so on. The structure of an movie, i.e., the number and specification of streams, the type and the preferred compression type, is stored in an movie info file (moviename.amov), which is a human readable and editable text file. In , movies are specified in separate data objects connectable to this module. See Movie for details.
Optimized Movies
This module is capable of converting a movie to an optimized format, i.e., a format that comes up with faster playback speed and sometimes smaller but mostly bigger but fewer data files. To perform this conversion, connect a Movie to the input connection. That's the source movie. Then connect a Movie to the Result connection port. That will be the destination movie. In the stream specification for that destination movie only movie data files are allowed. The movie conversion is not able to write into single image files (which would not make sense anyway). After this, select convert (overwrite) for overwrite mode or convert (append) for append mode. To perform the conversion press one of the play buttons. Seeking does not affect the destination movie, so it is possible to seek to the part of interest in the source movie and start the conversion from there.
Which Movie or Image Format Should I Use ?
To maximize the playback speed:
- Store many images into one or a few big movie data files by performing the conversion process. This avoids the file searching overhead especially if there are thousands of single image files in a single directory.
- If the target system has limited CPU bandwidth, avoid using CPU-intensive operations like the post compression feature or a CPU-intensive image reader. To find out which image reader is the fastest you have to experiment, since it depends on the individual hardware and software configuration. If the systems OpenGL implements the extension GL_ARB_texture_compression, you can compress the images using OpenGL texture compression. This has the advantage, that the image size is reduced by factor 4 to 6 without the need for decompression by the CPU during playback, since the decompression is performed by the GPU.
- If the target system has limited harddisk bandwidth, compress the data by using high compressing single image formats like JPEG or the post compression feature in combination with the OpenGL texture compression feature if available. If the bandwidth of a single harddisk limits the playback speed, but there are more harddisks available (like on many PCs), store the movie in multiple streams (described above), each of them stored on a different harddisk. On systems with RAID the movie should be stored in a single stream, since the RAID should distribute the movie data file over many disks, which should already increase the retrieval bandwidth. Using more than one stream jams the RAID strategy used for fast retrieval of large disc files, which results in a slowly and bumpy playback.
To maximize the playback image quality:
- Choose a loss-free image format during movie creation outside of this module and also during movie conversion with this module. RGB(A) and gzip postcompression are loss-free. OpenGL texture compression is lossy.
Known Issues
- When playing single images with readers that are not thread safe, may crash. In this case, one can set the value in the Movies MaxThreads-port to 1 which sets the maximum number of reader-threads to one, what makes the playback speed slow but allows a conversion to the optimized format. On most platforms the JPG-reader should be thread-save. The BMP-reader is known to be not thread-save.
Data
Connect the Movie the module is going to play or convert.
Action
Press this button to create a new Movie data object connected to this player via the movie's Master port. Filename and type of this newly created movie are initialized according to the properties of the input movie. The default number of streams is one. Alter the settings within the input movie object to match your needs before converting data into that movie.Mode
Set this to specify the action the module should perform. If set to play, the module will play the movie connected to the data connection port. If set to play result, the module will play the Movie connected with its Master port. If set to convert (overwrite), the module performs the movie conversion from the source Movie to the destination Movie. The old contents of the destination movie are deleted first. If set to convert (append), the module appends the contents of the source movie to the destination movie.Position
This slider displays the current position in the movie during playback. By pulling the slider it's possible to seek in the movie. With the two upper adjustable sub-range buttons one can limit the movie presentation to a smaller scene of interest. With the two outside buttons one can step through the movie, image by image, making it possible to use this module to present a series of single high resolution slides. By specifying an integer value in the text field one can jump directly to the specified frame. Note that the frame count begins with zero.Playback
Push these buttons to seek to the beginning of the scene of interest, to its end, to play the movie forward or backward, and to pause or unpause playback.Pixel format
This setting gets evaluated during the movie conversion process. If set to RGB(A) the images are stored loss-free to the movie data files, 24 bits per pixel if RGB and 32 bits if RGBA. Note the alpha blending feature of this module which is enabled if the input image contains an alpha channel ( is capable of creating screenshots with an alpha channel). If GL-compress is enabled and the systems OpenGL is capable of compressing textures, this module compresses the images using OpenGL. Note that this kind of compression is lossy. If it is not available on the current system, this option is disabled.Post compression
This setting is evaluated during the movie conversion process. Specify this for the destination movie. If enabled, the Movie Player module compresses the image, independent of the selected pixel format, with GZIP. The result is smaller movie data files that need more CPU power during playback. Note that only parts of the movie stream file are going to be compressed, so it is not possible to compress the whole file with an external zip encoder application.Chunk size
This setting is evaluated during the movie conversion process. Sometimes the resulting movie data file gets too large. With this option one can request the module to split this file into pieces during creation. The fragments are named filename.amovstream, filename.00000001, filename.00000002, ..., filename.0000000N. A value of 0 disables the split feature. A value greater 0 specifies the maximum fragment size in megabytes (each 1,048,576 bytes). One can split an movie stream file with external tools into fragments with arbitrary sizes. If the naming scheme matches the one mentioned above, the module will play it correctly. Note that there is an movie index file maintained by this module, which holds file numbers and byte offsets for every image on this stream. After manual splits or to force a recreation of this index file, simply remove it. At the next attempt to play or seek this stream, this module will scan the movie stream file and recreate the index file.