[Creating procedures...] [Table of Contents]

Still under major construction...

Basic Operations on Sequences


A sequence, the Rivl abstraction for video, can be thought of as a set of time-stamped images. To see a description of any of the sequence primitives in Rivl, look under SEQUENCE TRANSFORMS in the Table of Contents. Sequence transforms are used in the exact same way as for images (see Getting started and Basic Operations on Images). There are four main classes to sequence operations.

  1. Input/output (seq_read and seq_write)
  2. Assembly operations, operations to split and join sequences. For instance joining a number of short sequences to one long one.
  3. Scaling and translation in time. Reversing a sequence in time or speeding it up.
  4. A bridge between images and sequences. For instance constructing a sequence from a list of images.

The basic steps on getting started are the same for sequences as for images, there are however some differences. The difference between seq_read and im_read is that while im_read reads in one image file, seq_read reads in a series of image files. Seq_read does not read in an mpeg movie, it reads in all the individual image files that together create the mpeg file. So if you wish to apply some effect to an mpeg clip the first step would be to turn the mpeg clip into a series of individual frames. The syntax for seq_read is seq_read filepat where filepat is either a directory or a glob pattern. Say you have already split the mpeg clip into jpeg images and stored them all (and nothing else) into the directory "./movies/indy". Using the command seq_read ./movies/indy will return a handle to the entire sequence constructed from the individual files. This handle (for instance rivl_seq1) is what you refer to when you want to apply an effect to the sequence.

How does Rivl know what order to put the images in when creating the sequence? All the images must be numbered in the right order. That is, the names of the files must be of the type in_000.ppm in_001.ppm ... in_089.ppm in_090.ppm or something similar. This is done automatically when using the tool for turning mpeg files into jpeg files.

The sequence you are working on can be viewed any time using "seq_display". The command seq_display seq will display the individual frames of the sequence at any interval. Here's an example of what your seq_display window might look like:

When you are happy with your modified sequence, use seq_write to turn the Rivl sequence into a series of image files. Similarily to seq_read, use the command seq_write seq filepat. However, unlike seq_read, it is not sufficient to just give a directory for "filepat", a pattern is required. For example, "out%03d.ppm" (or jpg if you wish) results in out000.ppm, out001.ppm etc.. You must now use some independant image-to-sequence tool (for instance mpeg_encode) to turn all your image files into one mpeg file.


[Top]