<< Indiva Home

Client Applications

Indiva Shell (ish)

The Indiva shell consists of a set of Tcl commands for communicating with an Indiva Manager. These commands are contained in a namespace called Indiva, defined in mash-code/mash/indiva/applications/ish/indiva-shell.tcl. To run the shell, you need to make sure that you have dp-lib.tcl and indiva-shell.tcl in your current directory. From within tclsh, do

source indiva-shell.tcl

To run a command in Indiva, you prefix the command with "Indiva::". For example, if you want to run "ls", you type

Indiva::ls

You can avoid typing Indiva:: all the time by importing all the commands in Indiva into your current namespace.

namespace import -force Indiva::*

Note that some Indiva commands conflict with existing Tcl command (e.g. cd). The namespace import command above uses the "-force" option to overwrite any existing Tcl commands that conflicts with Indiva. You can no longer access the original Tcl commands, except for info.

The available commands are summarized below:

mount

mount name hostname[:port]

mount creates an access point for accessing resources in an Indiva domain. mount takes two arguments: The first one is a name you give to the domain you want to access. name must be a non-empty alphanumeric string, optionally prefixed with a "/". The second argument is the hostname and port number of the Indiva server. This is given in the form of hostname[:port]. If port is ommited, the default port 9500 is used.

Calling mount without any argument returns a list of mounted domain as a list of triples { name host port }.

After mounting an Indiva domain, you can access the resources of that domain under /name. A mounted domain can be removed using the umount command.

umount

umount name

umount removes a mounted domain named name from the shell.

cd

cd dir

Indiva shell maintains a current working directory (cwd). cd sets cwd to dir. dir can be either absolute or relative.

Note that, currently we do not have a notion of home directory. Hence, unlike its UNIX counter part, dir is not optional.

pwd

pwd

pwd returns the absolute path to cwd.

ls

ls [name]

ls returns the current content of name as a list. name can be either an absolute path, a relative path, or a glob-style regular expression. If name is not give, it is taken to be cwd. ls throws an error if name does not exist.

If name is a regular expression, all matching files and directories are returned. However, ls does not recursively list the content of directory when name is a regular expression (i.e. It behaves like "ls -d" in Unix).

ln

ln src [dest]

ln creates an alias of src in dest. It behaves just like ln -s in UNIX. If dest already exists, it must be a directory. In this case, an alias with the same name as src is created in dest. If dest does not exist, then an alias of src called dest will be created. If dest is not specified, it is taken to be cwd.

If src is a stream, then dest must be a session of matching type. Creating an alias of a stream causes packets from the stream to be forwarded into the destination session. Changing the properties of the original stream will change the properties of the linked stream as well.

rm

rm name

rm removes a resource named name from the Indiva domain. You can only remove RTP streams, sessions, conferences, and links (created by ln).

Removing sessions and conferences removes all their contents (recursively) as well. Removing a stream has the side effect of removing the encoding services as well.

info

info name [-attrname -attrname ...]

info returns textual information about resource name. If no attribute is given, info returns a list of all attributes associated with name, as a list of "attribute {value}" pairs.

If a list of attributes is given, info returns the values for the given attributes in the order that they are specified as a list.

Any resource attribute can be queried using info. Furthermore, the following predefined attributes can be queried as well:

link
For a link, the value of this attribute is the actual resource name this link is pointing to. (Indiva follow the link until it finds a non-link resource. Hence, a cycle in your links can lead to infinite loop.) If a resource is not a link, the value of this attribute is the name of the resource.
class
the classid of the resource as defined the class table.
device
For a port, the value of this attribute is the name of the device containing the port. If the resource is not a port, the value of attribute device is the name of the resource.

The value of an undefined attribute is the empty string.

Confused? Here is an example. Say we have a resource called foo with two attributes a and b with value 1 and 2 respectively. Here is the sample output.

      % info foo
      a {1}
      b {2}
      % info foo -a
      1
      % info foo -b -c
      2 {}

ish treats info commands as calls to Indiva's info. If an error occurs while processing an info calls, it assumes that the user meant to call Tcl's info instead. Indiva's info then makes a call to Tcl's info (which BTW, has been renamed to tclinfo).

find

find root [-attrname value -attrname value ..]

find returns the list of resources (recursively) under the subtree rooted at root, that matches every given attribute names and values. Values can be given as glob style regular expression. Any resource attribute can be used for matching, including link, class, device. You can also search by resource name using attribute -name.

mkdir

mkdir dir

mkdir creates a new user-defined directory called dir. dir can be either absolute or relative to cwd.

You can put any resource under a user-defined directory. Typically, a combination of mkdir and ln are used to create and organize aliases to resources that are of interest to a user.

mkses

mkses dir [-attrname value -attrname value ..]

mkses creates a new session called dir. Sessions must be created under a conference directory (either created by user with mkcon, or created by Indiva when SAP announcements are received).

If the suffix of dir does not contain ".ses", it will be appended automatically to dir.

The pair -attrname and value configures the session. Valid attribute names and values include the followings:

-addr
Multicast address for the session
-port
Multicast port for the session
-ttl
Multicast TTL for the session
-type
Content type of the session ("video" or "audio")
-fmt
Default format for streams in the session (for example, "mjpeg", "h261")
-size
Default size for video streams in the session (for example, qcif, 80x60) [Does not have any effect on the encoder, yet.]
-fps
Default frame rate for video streams in the session
-bps
Default maximum bit rate for streams in the session (in bps)
-q
Default quality value for the session (range and interpretation depend on the format)

mkcon

mkcon dir [-attrname value -attrname value ..]

mkcon creates a new conference called dir.

If the suffix of dir does not contain ".con", it will be appended automatically to dir.

The list -attrname and value configures the conference. SDP-based attributes are supported.

-name
Name of the conference.
-description
Description of the conference.
-phone
-email
Contact info for the person responsible for this conference.
-addr
Address of this conference
-bw
In the form of bw[:modifier]. bw is the bandwidth limit in kbps. modifier specifies what this limit applies to. It can be either CT (for conference total) or AS (for application specific).
-encrypt
The k=... in SDP announcement.

Sometimes you might want to create a conference based on an SDP announcement. Instead of specifying all the above arguments, you can give mkcon the SDP announcement as a string, using the -sdp option.

-sdp
String containing SDP announcement for the conference to be created. If the SDP announcement contains sessions information, mkcon calls mkses to create the sessions.

encode

encode source [target] [-attrname value -attrname value]

encode launches encoder services in the Indiva domain to encode video and audio signal from source. source can be one of the following: a port, a device or a channel. If source is a device with defaultout attribute defined, encode will encode the signal from the defaultout port. Othwerwise, all ports under the device will be encoded. (WARNING: Passing a 64x64 routing switcher to encode is not a wise idea.) If source is a channel, all ports in the channel (normally one audio port and one video port) will be encoded.

target must be either a conference or a session. If target is a conference, then all sessions in the conference is treated as targets. If no target is given, then ish checks if a variable called $stdconf is defined. If it is, $stdconf (the standard conference) will be used as target. If no $stdconf is defined, encode creates a temporary conference under $root/.Temporary directory and uses that as the target.

For each port specified by source, there MUST be EXACTLY one session in the target that matches the type (video or audio) of the port. Otherwise encode returns an error.

encode will also return an error if it cannot find a route from source to target.

The pair -attrname and value configures the encoding process. The following attributes are supported, but only make sense if you are encoding a single stream.

-fmt
Format of encoded stream. (for example, "mjpeg", "h261")
-size
Default size for video streams in the session (for example, qcif, 80x60) [Does not have any effect on the encoder, yet.]
-fps
Frame rate for encoded video streams.
-bps
Maximum bit rate for encoded stream (in bps).
-name
Name of the created stream. Default is the CNAME of the stream.

route

route source dest

route tells the routing network to switch a signal from a source to a destination. source must be either a port or a device with defaultout attribute defined. dest must be a port. route returns the destination port.

view

view name [name ...]

view runs the Indiva Viewer (iview) on the client to display RTP streams in the given media resources. name can be either conferences, sessions or streams. Viewing a conference is equivalent to viewing all sessions in that conference. Viewing a session is equivalent to viewing all streams in the conference. If name are streams, only the corresponding streams are displayed, other streams in the same session will be muted.

view returns the arguments.

configure

configure name [name ..] [-attrname value -attrname value]

If no attribute names are given, configure launches ictrl, which is a GUI for configuring the devices along the flow coming into the list of given resources.

If a list of attribute names and values are specified, ictrl will not be launched. Instead, two things will happen: (i) the list of attributes and values will be added to the named resources as their attributes, overwriting any existing attribute with the same name. (ii) the list of attributes and values will be passed to the service for that resource (if applicable). This may change the behavior of the service. Attributes unrecognized by the service will be silently ignored. See service documentation for a list of attributes they support.

pipe

cmd1 args | cmd2

The | operator takes return value from one command and send it into another command as arguments. This is equivalent to "cmd2 [cmd1 args]". cmd1 must support this operator. Currently, only encode supports pipe.

redir

cmd1 args > name

The > operator causes name to be treated as the destination of cmd1. cmd1 must support the redirection operator. Currently, only encode supports it. "encode x > foo" is equivalent to "encode x foo".

Using iview

iview is a media resource viewer for Indiva. It can contact the Indiva Manager to retrieve information for media resources. One way to launch iview is through the view command of ish. You can also launch iview from the command line.

iview [options] [resources]

The supported options are:

-imgr hostname[:port]
hostname is the name of the host running imgr, and port is the RPC port for imgr. If port is not specified, the default port 9500 is used.
-domain name
A name given to the Indiva domain.

resources are a list of media resources (given as absolute Indiva names). Here is an example:

iview -imgr otto:9500 -domain bmrc /bmrc/conf/lecture.con /bmrc/conf/demo.con/video.ses/audience.rtp

iview can also run as a conventional, Indiva-independent application. Instead of giving iview Indiva names as parameters, you can specify the session specifications instead.

-vsess addr/port/ttl
-asess addr/port/ttl
The video and audio sessions to listen to.
-vsrcid ssrc
-asrcid ssrc
Display only the video source and audio source with this ssrc. If no SSRCs are given, iview displays all sources in a session by default. You can only specify at most one video SSRC and one audio SSRC.

For example,

iview -vsess 224.1.2.3/12002 -asess 224.1.2.3/12004 -vsrcid 9087696

Using ictrl

ictrl is a simple GUI interface to the IndivaController class which is responsible for displaying control GUI for devices in Indiva. You normally launch ictrl through the configure command in ish. You can also launch ictrl directly without using ish. The usage of ictrl is

ictrl names hostname[:port]

The last command line argument to ictrl is taken to be the hostname and port number of a Indiva Manager. The rest of the arguments are absolute path names to Indiva resources. For example,

ictrl /bmrc/conf/live.con/video.ses/foo.rtp /bmrc/conf/live.con/audio.ses/bar.rtp otto:9500