NAME

     mpegSegment - Create a new mpeg file segment object.


SYNOPSIS

     mpegSegment parentName ?option?


OPTIONS

  -lts
     Indicates which lts object to use  for  timing  information.
     This  option  must  be  set  at some time before the segment
     object will do anything.

  -sendAhead
     Indicates how many seconds  in  advance  to  send  data.  By
     default, this value is set at 0.2 seconds.

  -bandwidth
     Indicates maximum number of bytes per second to send. If set
     to  0,  no  maximum  is  enforced.  For  this option to work
     correctly, cycleTime must not  be  non-zero.  See  cycleTime
     option below.

  -cycleTime
     Indicates how many seconds worth of data to send at a  time.
     If  set  to 0, the object will send data one frame at a time
     and schedule itself to be called again when the  next  frame
     needs to be sent.

  -filename
     Indicates which file to use as a mpeg file. If this file  is
     not  in  the  correct  mpeg  chunk  file  format, the object
     attempts to read the file as a plain  mpeg-1  video  stream.
     This option can be set only once.

  -outCmd
     Indicates the command to call when sending data.  This  com-
     mand  will  be  appended  with  a  scatter  buffer  list and
     evaluated. A C interface to a scatter buffer list  accepting
     command can be specified using the @ syntax discussed in the
     application programmer's guide.

  -maxFrameRate
     Used to specify a maximum sending frame rate. If set  to  0,
     no maximum frame rate is enforced. This option only works if
     cycleTime is non-zero (see cycleTime above).

  -clipStart
     Used to specify where in the clip the segment begins. If set
     to "?", this value is computed from the other timing parame-
     ters as:
     clipStart = clipEnd - (logicalEnd - logicalStart)

  -clipEnd
     Used to specify where in the clip the segment ends.  If  set
     to "end", indicates the end of the clip. If set to "?", this
     value is computed from the other timing parameters as:
     clipEnd = clipStart + (logicalEnd - logicalStart)

  -logicalStart
     Used to specify when in logical time the segment  should  be
     sent. This value must be less than the value for logicalEnd.
     If set to "?", this value is computed from the other  timing
     parameters as:
     logicalStart = logicalEnd - (clipEnd - clipStart)

  -logicalEnd
     Used to specify when in logical time the segment should end.
     This  value  must be greater than the value for logicalStart
     If set to "?", this value is computed from the other  timing
     parameters as:
     logicalEnd = logicalStart + (clipEnd - clipStart)


DESCRIPTION

     The mpegSegment command creates a new  mpeg  segment  object
     which can be used to read mpeg data from a file and send the
     data to another object. Data  is  sent  using  the  standard
     scatter  buffer  list  method  and can be sent to any object
     that can accept scatter buffer lists. The data  is  intended
     to  be  eventually received by a mpegPlay object which would
     presumably display the frames in a window.  The mpeg segment
     object  expects  the data to be stored on disk in the format
     of a mpeg chunk file. If this format is not true of the file
     specified,  the  object attempts to read the file as a stan-
     dard video only mpeg-1 file  and  the  information  normally
     found in a chunk file is created on the fly.


WIDGET COMMANDS

     The mpegSegment command creates a  new  command  objectName.
     ObjectName is generated by concatenating the value of parent
     and a unique string which is  generated  on  the  fly.   The
     empty string is a valid value for parent.  This new command,
     objectName, is used to invoke various operations on the  new
     object.

     For more information on object names and why they  are  gen-
     erated  by  the  cm  process and not set by the user, please
     read the object management overview for the cm toolkit.

     The command objectName has the following general form:

          objectName option ?arg arg arg...?

     Option and the args determine the exact behavior of the com-
     mand.  The following commands are possible:
     objectName configure option ?value option value ...?
          Query or modify  the  configuration  options  described
          above.  If  the  object was in the ready state (see the
          ready command below), the configure  command  puts  the
          object  into the unready state, requiring the the ready
          command be given again for data to start flowing.

     objectName destroy
          Destroys the object.

     objectName info ?startTime ?endTime??
          Returns a list of information about the interval speci-
          fied  by  startTime  and  endTime.  If neither value is
          given,  information  is  returned  about  the  interval
          defined  by  the  attribute -clipStart and -clipEnd. If
          only startTime is given, information is returned  about
          the  specific  frame  at  the time given. All times are
          taken as clip times (i.e. where  0.0  equals  the  clip
          beginning). The information returned consists of a list
          of five numbers: {numFrames maxSize  numI  numP  numB}.
          The  numFrames  number indicates how many frames are in
          the interval, maxSize indicates the maximum frame  size
          of  all frames in the interval, and numI, numP and numB
          indicate the number of I, P, and B frames in the inter-
          val respectively.

     objectName ready
          This command readies the object. The lts is checked  to
          see  if  data needs to be sent. If so, data is sent and
          the object queues itself  to  send  data  according  to
          cycleTime. Before ready can be invoked, the -lts option
          must be specified  and  -clipStart  and  -clipEnd  must
          specify  an  inteval  with length greater than 0 (i.e.,
          clipStart cannot equal clipEnd). The same is  true  for
          -logicalStart and -logicalEnd.

     objectName unready
          This command unreadies the object  stopping  data  from
          being sent.

     objectName width
          Returns the width of the video image. Returns 0 if  the
          object hasn't been told which file to use.

     objectName height
          Returns the height of the video image. Returns 0 if the
          object hasn't been told which file to use.



KEYWORDS

     cm, mpeg, file, segment, mpgc, mpegSegment, MPEG, MPEG-I


AUTHORS

     Ketan Patel (kpatel@cs.berkeley.edu)