Chapter 9. Introduction to MVCP

This chapter describes common tasks you routinely perform using MVCP commands. Each task is discussed in a tutorial fashion to introduce you to the way MVCP works. Once you master the basic tasks presented in this chapter, you can proceed to the other features offered by MVCP commands.

The tasks presented in this chapter are not logically sequential, but modular. There is a flow to the MVCP commands as presented; however, one command does not necessarily build on the one presented previous to it.

After completing a number of these tasks you will gain a feeling for the MVCP commands.


Note: For a more detailed explanation of MVCP commands, see the mvcp(5) man page.

This chapter describes the following tasks:

Manual Access to Video Server Technology

Video Server Technology (VST) applications routinely open a TCP/IP connection to a host running VST on the MVCP port, normally 5250. The application sends MVCP commands to control VST.

The port value is set in the file /usr/vtr/config/control-in.conf. For example, to set the port to 5250, use the following line in the file:

mvcp tcp 5250


Note: Do not change the port value from 5250 unless it is absolutely necessary.

You can, however, manually control VST by opening a telnet connection to a host running VST and then issuing MVCP commands to control it. For example:

152% telnet server 5250
Trying 130.62.156.178...
Connected to server.
Escape character is `^]'
100 VTR Ready

To exit the telnet session, type the following command:

BYE

Creating and Deleting a Unit

A unit is a virtual VTR. It can play and record video and audio just like a VTR.

The UADD command, which you can use to create units, returns the name of the unit as shown in the following example:

% UADD MFCODEC_0 * SHAR
202 OK
U1

U1, in this case, controls the MFCODEC_0 video board, which includes both an input video port and an output video port.

Deleting a Unit

Units can be deleted using the following command:



UCLS unit-name

Multiple Connections to a Unit

Once a unit has been created, it can be controlled by a number of MVCP connections by opening it:



UOPN unit-name

When multiple MVCP connections are made to one unit, the unit is not deleted until all of the connections have deleted it.


Caution: Opening a unit owned by a Sony or VDCP port using MVCP commands (for example, UOPN) causes unpredictable behavior.


Loading, Creating, and Unloading a Clip

To load and unload a clip into a unit, use the following commands, respectively:



LOAD unit-name clip-name OUT CRTE


UNLD unit-name

unit-name  

Specifies the name of the unit on which the clip is loaded.

clip-name  

Specifies the name of the clip to be loaded.

The OUT option means that the clip, clip-name, can only be played, not recorded onto. Other valid values include IN, which means the clip will be recorded onto, and BOTH, which means the clip can be played or recorded onto.

CRTE creates the clip. Without a CRTE argument, the clip does not exist in the clip cache.

Finding the Name of a Clip

If you do not know the name of a clip, you can list all of the clips by issuing the clip list command:



CLS

Setting Edit Points

The in and out edit points specify where the source video is to begin and end playing, and where the beginning and ending recording points are on the record deck, usually the SGI Media Server.

When a clip is played, by default the edit in point is used as the starting point for play.

To set edit points, use the CEDP command:

CEDP clip-name in-point out-point


Note: The media outside of the in and out points is not actually erased; it will not be played.


Cueing Decks to Play or Record

You can play and record on units without cueing them. There is, however, a good chance that the beginning of the playing or recording will not be clean; the frame count might be off by several frames or the audio might be garbled.

You can avoid these problems by cueing the units for playing or recording.

To cue a clip for playback, enter the following:



CUE unit-name

To cue a clip for recording, enter the following:



CUER unit-name

The following optional CUE and CUER arguments specify the segment of media to play, the direction of play, and how many times the segment is played:

CUE unit-name in-point out-point direction number-of-passes

Values for direction include FWD (forward), BWK (backward), F/B (play forward and then play backwards), and B/F (play backward and then play forward).

Sequencing Commands

There is a variety of sequencing operations you can use, including the following:

  • Sequence more than one command to execute on a unit.

  • Prepend a command in the list of commands.

  • Delete the command list and replace it with a command .

For information about command sequencing, see the mvcp(5) man page.

Playing a Prerecorded Clip

To play a clip, use the following procedure:

  1. Open a TCP/IP connection to a host machine running VST.

    If successful, VST responds:

    100 VTR Ready
    

  2. Create a unit, which is a virtual videotape deck:

    % UADD MFCODEC_0 * SHAR
    

  3. Load the clip:

    % LOAD unit-name clip-name OUT 
    

    unit-name  

    Name of the unit on which the clip is loaded

    The OUT option means that the clip, clip-name, can only be played, not recorded onto.

  4. Cue the clip for playback:

    % CUE unit-name
    

  5. Play the clip:

    % 
    
    PLAY unit-name speed
    

    speed  

    Specifies the speed of the playback; for example, 1000 is normal play and –1000 is normal reverse play.

You can also play the clip in other modes, such as the following:

FF 

Fast forward.

JOG 

Advance or reverse one frame at a time.

SHTL 

Variable-speed fast forward or fast reverse (shuttle).

For more information about the arguments for each of these commands, see the mvcp(5) man page.

Setting and Listing Configuration Values

VST c onfiguration variables are called controls. The two major categories of controls are the following:

Device-specific 

You use the SET and GET commands to specify and retrieve the control values for individual media units that control communication with the video port and audio.

System-wide 

You use the SSET and SGET commands to specify and retrieve the control values for global system values—for example, the log level.

To set or get the configuration variables for a specific unit, you have to select the subset of controls you want to set by using STOR (storage) or MED (media). For example:

SET unit-name MED vtr.media.video.input.compression.type dvcpro
GET unit-name MED vtr.media.video.output.*

These commands set the video compression type to DVCPRO 25 and return all of the video output controls for the specified unit.

Listing Video and Deck Control Ports

To display the configuration of video and deck control ports, use the port list command:



PLS

Assigning Audio Inputs

To identify which audio port to use by a given MFCODEC unit, use the SET command for a unit as shown in the following:

SET unit-name MED vtr.media.audio.input.channel_map.channel_pair “1231” SET unit-name MED vtr.media.audio.input.channel_map.source “EEEA”
SET unit-name MED vtr.media.audio.input.channels 4

Alternately, you can configure a unit in /usr/vtr/config/device-defaults/*. For example, in MFCODEC_1 you would enter:

vtr.media.audio.input.channel_map.channel_pair “1231”
vtr.media.audio.input.channel_map.source “EEEA”
vtr.media.audio.input.channels 4

Configuring Video Recording Compression

To record video using the SGI Media Server, you must set the compression type using vtr.media.video.input.compression.type. The valid values follow:

Value 

Description

dv 

For DVCAM or DV (16-bit/48 Khz audio only), DCT-based compression

dvcpro 

For DVCPRO 25, DCT-based compression

dvcpro50 

For DVCPRO 50, DCT-based compression

mpeg2 

For SGI MPEG-2 long GOP, IMX, or I-frame recording

For a description of the compression types, see section “Media Formats” in Chapter 5. 

Recording a Clip

To record a clip, use the following procedure:

  1. Open a TCP/IP connection to the SGI Media Server.

    If successful, the server responds:

    100 VTR Ready
    

  2. Create a unit, which is a virtual videotape deck:

    % UADD MFCODEC_0 * SHAR
    

  3. Configure VST for audio and video recording as described in sections “Assigning Audio Inputs” and “Configuring Video Recording Compression”.

  4. Load the clip:

    % LOAD unit-name clip-name BOTH CRTE
    

    unit-name  

    Specifies the name of the unit on which the clip is loaded.

    clip-name  

    Specifies the name of the clip is to be loaded.

    The BOTH option means that the clip, clip-name, can be played or recorded onto. The CRTE option means that the clip should be created if it does not exist.

  5. Cue the clip for recording:

    % CUER unit-name
    

  6. Record onto the clip:

    % 
    
    REC unit-name 
    

Editing Clips

You can edit clips on two levels of granularity:

  • Clip

  • Frame

Editing at the Clip Level

The following MVCP commands provide basic editing functionality for a clip already loaded in a unit:

CEDP 

Sets in and out edit points.CEDP in-point out-point

CRM 

Removes a clip.CRM clip-name

CCP 

Copies a clip.CCP clip-name new-clip-name

CMV 

Renames a clip.CMV clip-name new-clip-name

CLN 

Creates a new clip that shares its contents with an existing clip.CLN clip-name new-clip-name

When using CLN, changing one clip also changes the renamed clip because of their link.

For more information about setting in and out editing points, see “Setting Edit Points”.

Editing at the Frame Level

The following MVCP commands manipulate the frames within a clip that is already loaded in a unit:

FRM 

Removes a frame. In film, the equivalent is cutting out frames of film and splicing the two parts of the film back together.FRM unit-name in-frame out-frame

FCLR 

Changes (clears) a frame to black but does not remove it.FCLR unit-name in-frame out-frame

FNEW 

Inserts a black frame into the clip.
FNEW
 unit-name in-frame out-frame

FOVR 

Moves frames from one part of a clip and overwrites frames in another part of the clip.
FOVR
 unit-name source-in source-out dest-in

FINS 

Moves frames from one part of a clip and inserts them in another part of the clip.
FINS
 unit-name source-in source-out dest-in

Displaying Your Logo

You can use the MVCP SET command with the following controls to display your company logo, or any image, when the video port is not playing a clip:

vtr.media.output.idle_mode idle-mode
vtr.media.video.output.image.type image-type
vtr.media.video.output.image.name image-name

Place image files in directory /usr/vtr/data/images.

Playing Clips from a Playlist

The commands to execute a playlist can be performed over a single MVCP control connection. Some control implementations may find it easier to use a unique MVCP control connection for each unit. The commands and the order in which they are sent is identical in either case.

  1. Create a unit on the media port.

    % UADD port
    202 OK
    U1
    

  2. Create a second unit on the same media port.

    % UADD port
    202 OK
    U2
    

  3. Load the first clip into U1.

    % LOAD U1 clip1 OUT
    202 OK
    clip1 movie/dif/dvcpro 108969984 108969984 00:00:00.00
     00:00:30.08 * * 29.97 19990415T004204.435814Z CL
    

  4. Cue U1 with a mode that will return when the command is placed in the command queue.

    % /SEQA CUE U1
    200 OK
    

  5. Play U1 with a synchronization mode where a response will be returned only when the unit has started executing the command.

    % /SEQA /SYNR PLAY U1
    200 OK
    

  6. Load next clip into U2.

    % LOAD U2 clip2 OUT
    202 OK
    clip2 movie/dif/dvcpro 108969984 108969984 00:00:00.00
     00:00:30.08 * * 29.97 19990415T004130.833005Z CL
    

  7. Cue U2 with a queued command.

    % /SEQA CUE U2
    200 OK
    

  8. Play U2 as with U1 above.

    % /SEQA /SYNR PLAY U2
    200 OK
    

  9. Load next clip into U1.

    % LOAD U1 clip3 OUT
    202 OK
    clip3 movie/dif/dvcpro 108969984 108969984 00:00:00.00
     00:00:30.08 * * 29.97 19990415T004148.636950Z CL
    

  10. Cue U1 with a queued command.

    % /SEQA CUE U1
    200 OK
    

  11. Play U1 as above.

    % /SEQA /SYNR PLAY U1
    200 OK
    

Monitoring Unit State

When executing a play list, you can display the state of the list execution. Using MVCP this can be accomplished by polling, but a more efficient solution is to utilize unit monitoring. Unit monitoring provides asynchronous events describing the change in state of a unit, such as execution state, loaded clips, or timecode location. Details of unit monitoring can be found in the section “Monitoring”. Typically, a separate MVCP connection will be initiated for monitoring.

In the play list algorithm in the preceding paragraph, a unit monitor could be started after the units are created to trace unit execution. This would allow a control application to trace which clip was being played and the timecode location of the unit in the clip. Note that the information provided by unit monitoring describes the unit state and locations. The actual video frame timecode leaving the server port will be some fixed number of frames behind that time due to codec delays. This delay is format-dependent and can be found in Table 9-1. The table shows the difference between the time reported by the unit and the actual video frame at the server port at that time. For instance, with DVCPRO 25 on record the unit status reports three frames behind the frame on the input of the server, and on play the unit status reports seven frames ahead of the frame on the server output port.

Table 9-1. Time Reported by the Unit and the Actual Video Frame

Format

Record Unit State (frames)

Play Unit State (frames)

DVCPRO 25

–3

+7


Monitoring the System

This section explains the following ways to monitor the system:

Status

You can display the status of one unit or all units using the following commands, respectively:



USTA unit-name


ULS

Monitoring

For continuous monitoring of a unit, use the MON command:

MON [unit-name] [/ event-type]

unit-name  

Specifies the unit to be monitored. If you omit unit-name, all of the units are monitored.

event-type  

Specifies the types of events to be reported. You can receive notification when any of the following events occur on a unit in the clip cache, as appropriate:

UADD 

Unit added

URM 

Unit removed (using UCLS)

UCHG 

Unit state changed

UCTL 

Unit control changed

UERR 

Unit error

CADD 

Clip added

CRM 

Clip removed

CEDP 

Edit points changed

CCHG 

Clip media changed

CMV 

Clip moved

CCHP 

Clip protection changed

You can add one or more of these event types to the MON command after the slash (/) that separates the unit names from the event types.

If event types are not specified, notification of UCHG, URM, and UCTL events are returned. If a unit name is not specified, notification of each UADD event is returned.

The MON command prevents an MVCP connection from processing any further commands. To stop monitoring, you must either close the MVCP connection or issue another command on the connection, at which time monitoring is terminated.

Statistics

Two MVCP commands provide statistics:

  • STLS

  • STST

The following subsections describe them.

STLS—List Statistics

You can return statistical values for one or all components in a system using the list statistics command:

STLS [component-name [statistics-type]]

component-name  

Specifies the name of the component about which you want statistics . If omitted, statistics for all components are returned.

statistics-type  

Specifies the type of statistics you want returned. If omitted, all statistics for the specified component are returned.

If successful, the STLS command returns a line of the following form:

component-name statistics-type statistics-value...

To see the list of available statistics, type the following:

STLS * *

STST—Statistics on Statistics

You can return statistical values about a component or all components' statistics using the following command:

STST [component-name [statistics-type]]

For example, the following command calculates all the statistics for components that contain “MFCODEC” in their names:

STST *MFCODEC*

If the command is successful, a single line is returned in the following format:

values samples min max sum mean stddev 

values  

Specifies the number of statistical values matching the pattern.

samples  

Specifies the total number of samples collected.

min  

Specifies the minimum value.

max  

Specifies the maximum value.

sum  

Specifies the sum of the values.

mean  

Specifies the mean of the values.

stddev  

Specifies the standard deviation of the values.

Error Reporting

The SGI Media Server reports three types of errors:

  • MVCP command syntax errors

  • Controller errors

  • Unit errors

MVCP Command Syntax Errors

All MVCP commands return error responses for syntax violations—for example, entering a letter instead of a number.

Controller Errors

All controller and non-unit errors, such as errors in renaming or deleting a clip, return a generic notification that something failed. To receive more specific information about the most recent global error that occurred for a specific controller, use the ERR command:

ERR 

This command returns an error code and a short description.

Unit Errors

Unit errors are errors in the execution of unit commands, such as PLAY, REC, and FF. When looking at the status of a unit, you might find it in the error state, as described in “Status”. In that case, you might like to get more information about the error.

To return unit errors, use the following UERR command:

UERR unit-name