K2 edge api source string format, Introduction, The vstream and astream fields – Grass Valley K2 Edge Protocol Manual v1.0 User Manual
Page 38: Vstream fields, Astream fields
K2 Edge Protocol Manual – document version 1.0 – Page 38
6. K2 Edge API Source String Format
6.1. Introduction
The source string format defines an asset source, using several field-value pairs. When nexos is told to
preload and play an asset, the asset' source file must be defined. The simplest way to do this is by
specifying a file name, as in "A00001.mpg". However, when only a subsection of the asset must be
preloaded and played, or when a specific selection of the available AV streams must be specified, a
simple file name will not work. The complex source string format allows describing a source as a group of
field-value pairs.
6.2. The vstream and astream fields
The vstream and astream fields (described below) allow for the selection and mapping of input video- and
audio streams to the video decoder's video- and audio outputs. For example, if the sum of the specified
input files provides more than one video elementary stream to play for a clip, or if only a subset is needed
from the sum of available audio streams (and possibly in a different order), the vstream and astream
fields are needed to define a routing table. This table connects a selected set of input streams to decoder
outputs ports. The decode output ports are connected to the nexos render engine.
6.2.1. vstream fields
The vstream0 and vstream1 fields represent the decoder's two video output ports. The vstream0 and
vstream1 fields instruct the decoder which of the available video elementary streams are to be used for
the main (vstream0) and secondary video decoder outputs. When playing a clip, only the main video
output is needed. When playing an animation, both video outputs are needed (the second to provide the
alpha channel).
The value of vstream0 and vstream1 represents an input video elementary stream, indicated by a small
integer index number. This number identifies a video elementary stream, among all the video streams
provided by all input files. The first video stream found receives index number 0. The stream index is then
incremented for all the video streams found in the same and following input files, where the files are
scanned in the order specified. Note that non-video streams are simply ignored in the count.
For example, assume we have two input files. File0 provides 2 video streams and 2 audio streams, and
File1 provides 1 video stream. In this case, the first input video stream (in File0) has index #0, while the
single video input stream in File1 (the third video stream) has index #2.
6.2.2. astream fields
The astream0, astream1... up to and including astream15 fields represent the decoder's 16 mono audio
outputs. Internally, nexos only works with mono audio streams, and the master audio mixer used in the
render engine supports up to 16 mono channels.
The value of the astream fields represents an input mono audio channel. Note that this is not an audio
elementary stream. The reason is that audio elementary streams often are multichannel streams,
delivering a number of mono audio channels in a single stream. For the decoder's audio routing table to
make sense, the astream fields must specify which mono audio input channel must be connected to
which of the decoder's audio mono output ports.
An input audio mono channel is indicated with a small integer index number, which identifies a given input
mono audio channel among all the mono channels provided by all the audio elementary streams,
provided by all the input files. The first audio mono channel found in the first audio elementary stream
receives index number 0. The channel index is then incremented for all the mono channels found in the
same- and following audio elementary streams, and the counting is continued for the following input files,