NAME
mjpegSegment - Create a new mjpeg file segment object.
SYNOPSIS
mjpegSegment 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 mjpeg file. If this file is
not in the correct mjpeg chunk file format, an attempt to
read the file as a Parallax XVideo .vid file, Parallax JMo-
vie file, and as a .avi file is made. If all these attempts
fail, an error is returned and no file is opened. 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 mjpegSegment command creates a new mjpeg segment object
which can be used to read mjpeg 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 mjpegPlay object which would
presumably display the frames in a window. The mjpeg seg-
ment object expects the data to be stored on disk in the
format of a mjpeg chunk file. If this format is not true of
the file specified, the object attempts to read the file as
a parallax j_movie, .vid, or J300 .avi file and parse the
information normally found in a chunk file on the fly.
WIDGET COMMANDS
The mjpegSegment 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 two numbers: {numFrames maxSize}. The numFrames
number indicates how many frames are in the interval
and maxSize indicates the maximum frame size of all
frames in the interval.
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, mjpeg, file, segment, mjpgc, mjpegSegment, .avi, .vid,
JMovie, cm toolkit
AUTHORS
Ketan Patel (kpatel@cs.berkeley.edu)