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:
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 |
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.
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. |
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.
If you do not know the name of a clip, you can list all of the clips by issuing the clip list command:
CLS |
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. |
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).
There is a variety of sequencing operations you can use, including the following:
For information about command sequencing, see the mvcp(5) man page.
To play a clip, use the following procedure:
Open a TCP/IP connection to a host machine running VST.
If successful, VST responds:
100 VTR Ready |
Create a unit, which is a virtual videotape deck:
% UADD MFCODEC_0 * SHAR |
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.
Cue the clip for playback:
% CUE unit-name |
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.
VST c onfiguration variables are called controls. The two major categories of controls are the following:
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.
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 |
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 | ||
| dvcpro50 | ||
| mpeg2 | ||
| For a description of the compression types, see section “Media Formats” in Chapter 5. |
To record a clip, use the following procedure:
Open a TCP/IP connection to the SGI Media Server.
If successful, the server responds:
100 VTR Ready |
Create a unit, which is a virtual videotape deck:
% UADD MFCODEC_0 * SHAR |
Configure VST for audio and video recording as described in sections “Assigning Audio Inputs” and “Configuring Video Recording Compression”.
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.
Cue the clip for recording:
% CUER unit-name |
Record onto the clip:
% REC unit-name |
You can edit clips on two levels of granularity:
Clip
Frame
The following MVCP commands provide basic editing functionality for a clip already loaded in a unit:
For more information about setting in and out editing points, see “Setting Edit Points”.
The following MVCP commands manipulate the frames within a clip that is already loaded in a unit:
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.
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.
Create a unit on the media port.
% UADD port 202 OK U1 |
Create a second unit on the same media port.
% UADD port 202 OK U2 |
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 |
Cue U1 with a mode that will return when the command is placed in the command queue.
% /SEQA CUE U1 200 OK |
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 |
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 |
Cue U2 with a queued command.
% /SEQA CUE U2 200 OK |
Play U2 as with U1 above.
% /SEQA /SYNR PLAY U2 200 OK |
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 |
Cue U1 with a queued command.
% /SEQA CUE U1 200 OK |
Play U1 as above.
% /SEQA /SYNR PLAY U1 200 OK |
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 |
This section explains the following ways to monitor the system:
You can display the status of one unit or all units using the following commands, respectively:
USTA unit-name ULS |
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.
Two MVCP commands provide statistics:
The following subsections describe them.
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 * * |
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. |
The SGI Media Server reports three types of errors:
MVCP command syntax errors
Controller errors
Unit errors
All MVCP commands return error responses for syntax violations—for example, entering a letter instead of a number.
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 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 |