Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z
faqs.org - Internet FAQ Archives

SGI movie Frequently Asked Questions (FAQ)
Section - -23- How do I write a program to access the pixels of a video frame in a movie file for image processing purposes?

( Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Cities ]


Top Document: SGI movie Frequently Asked Questions (FAQ)
Previous Document: -22- Does anyone know the maximum size a movie file that MovieMaker or MoviePlayer can handle? Is it limited by
Next Document: -24- How do I write a program which can write individual frames from a movie file out to a still image file?
See reader questions & answers on this topic! - Help others by sharing your knowledge
Date: Mon Mar 25 10:04:18 PST 1996

  Basic overview:

  You need to write the program using the Movie Library.
  Open the file using mvOpenFile(3mv), get a handle to the
  image track using mvFindTrackByMedium(3mv), then read the
  individual image frames using mvReadFrames(3mv).

  Details on the format of image data:

  The following libmovie calls return information to describe
  the format of the data returned by mvReadFrames():

  int           mvGetImageWidth      ( MVid imageTrack );
  int           mvGetImageHeight     ( MVid imageTrack );
  double        mvGetImageRate       ( MVid imageTrack );
  const char*   mvGetImageCompression( MVid imageTrack );
  DMinterlacing mvGetImageInterlacing( MVid imageTrack );
  DMpacking     mvGetImagePacking    ( MVid imageTrack );
  DMorientation mvGetImageOrientation( MVid imageTrack );

  For interlacing, packing and orientation, the types of
  formats can be found in <dm_image.h>.

  Once you have the description of format for the data in the
  image track, you can treat the buffer of untyped data
  returned by mvReadFrames() as an array of pixels.  If you
  need the data in a different format for your image
  processing or file I/O, you will need to perform the
  conversion yourself.

  For writing movies, the process works similarly.  Create a
  DMparams structure that describes the format of the data
  you will be writing, and pass that to mvAddTrack().  This
  creates an image track with the data format you want.  Then
  pass pixel data in that format to mvInsertFrames().

  Note that the Movie Library uses the MVid data type to
  represent both movies, and tracks within the movies.  So
  when you write a program to read or write image frames,
  you will have two MVid variables - one for the movie as
  a whole, and one for the image track embedded within the
  movie.

  Check the Digital Media Programmer's Guide and the Movie
  Library Manual pages for more details, as well as detailed
  instructions on how to use these calls.

  As of IRIX 6.2, since movies with multiple image tracks are
  supported, we recommend the use of mvRenderMovieToImageBuffer
  instead of mvReadFrames. Please see the man page for 
  this function.

User Contributions:

Comment about this article, ask questions, or add new information about this topic: