REST Resource: projects.locations.channels

Stay organized with collections Save and categorize content based on your preferences.

Resource: Channel

Channel resource represents the processor that does a user-defined "streaming" operation, which includes getting an input stream through an input, transcoding it to multiple renditions, and publishing output live streams in certain formats (for example, HLS or DASH) to the specified location.

JSON representation
{
  "name": string,
  "createTime": string,
  "updateTime": string,
  "labels": {
    string: string,
    ...
  },
  "inputAttachments": [
    {
      object (InputAttachment)
    }
  ],
  "activeInput": string,
  "output": {
    object (Output)
  },
  "elementaryStreams": [
    {
      object (ElementaryStream)
    }
  ],
  "muxStreams": [
    {
      object (MuxStream)
    }
  ],
  "manifests": [
    {
      object (Manifest)
    }
  ],
  "spriteSheets": [
    {
      object (SpriteSheet)
    }
  ],
  "streamingState": enum (StreamingState),
  "streamingError": {
    object (Status)
  },
  "logConfig": {
    object (LogConfig)
  }
}
Fields
name

string

The resource name of the channel, in the form of: projects/{project}/locations/{location}/channels/{channelId}.

createTime

string (Timestamp format)

Output only. The creation time.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

updateTime

string (Timestamp format)

Output only. The update time.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

labels

map (key: string, value: string)

User-defined key/value metadata.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

inputAttachments[]

object (InputAttachment)

A list of input attachments that this channel uses. One channel can have multiple inputs as the input sources. Only one input can be selected as the input source at one time.

activeInput

string

Output only. The InputAttachment.key that serves as the current input source. The first input in the inputAttachments is the initial input source.

output

object (Output)

Required. Information about the output (that is, the Cloud Storage bucket to store the generated live stream).

elementaryStreams[]

object (ElementaryStream)

List of elementary streams.

muxStreams[]

object (MuxStream)

List of multiplexing settings for output streams.

manifests[]

object (Manifest)

List of output manifests.

spriteSheets[]

object (SpriteSheet)

List of output sprite sheets.

streamingState

enum (StreamingState)

Output only. State of the streaming operation.

streamingError

object (Status)

Output only. A description of the reason for the streaming error. This property is always present when streamingState is STREAMING_ERROR.

logConfig

object (LogConfig)

Configuration of platform logs for this channel.

InputAttachment

A group of information for attaching an input resource to this channel.

JSON representation
{
  "key": string,
  "input": string,
  "automaticFailover": {
    object (AutomaticFailover)
  }
}
Fields
key

string

A unique key for this input attachment.

input

string

The resource name of an existing input, in the form of: projects/{project}/locations/{location}/inputs/{inputId}.

automaticFailover

object (AutomaticFailover)

Automatic failover configurations.

AutomaticFailover

Configurations to follow when automatic failover happens.

JSON representation
{
  "inputKeys": [
    string
  ]
}
Fields
inputKeys[]

string

The InputAttachment.keys of inputs to failover to when this input is disconnected. Currently, only up to one backup input is supported.

Output

Location of output file(s) in a Google Cloud Storage bucket.

JSON representation
{
  "uri": string
}
Fields
uri

string

URI for the output file(s). For example, gs://my-bucket/outputs/.

ElementaryStream

Encoding of an input element such as an audio, video, or text track. Elementary streams must be packaged before mapping and sharing between different output formats.

JSON representation
{
  "key": string,

  // Union field elementary_stream can be only one of the following:
  "videoStream": {
    object (VideoStream)
  },
  "audioStream": {
    object (AudioStream)
  },
  "textStream": {
    object (TextStream)
  }
  // End of list of possible types for union field elementary_stream.
}
Fields
key

string

A unique key for this elementary stream.

Union field elementary_stream. Required. Encoding of an audio, video, or text track. elementary_stream can be only one of the following:
videoStream

object (VideoStream)

Encoding of a video stream.

audioStream

object (AudioStream)

Encoding of an audio stream.

textStream

object (TextStream)

Encoding of a text stream. For example, closed captions or subtitles.

VideoStream

Video stream resource.

JSON representation
{
  "h264": {
    object (H264CodecSettings)
  }
}
Fields
h264

object (H264CodecSettings)

H264 codec settings.

H264CodecSettings

H264 codec settings.

JSON representation
{
  "widthPixels": integer,
  "heightPixels": integer,
  "frameRate": number,
  "bitrateBps": integer,
  "allowOpenGop": boolean,
  "vbvSizeBits": integer,
  "vbvFullnessBits": integer,
  "entropyCoder": string,
  "bPyramid": boolean,
  "bFrameCount": integer,
  "aqStrength": number,
  "profile": string,
  "tune": string,

  // Union field gop_mode can be only one of the following:
  "gopFrameCount": integer,
  "gopDuration": string
  // End of list of possible types for union field gop_mode.
}
Fields
widthPixels

integer

Required. The width of the video in pixels. Must be an even integer. Valid range is [320, 1920].

heightPixels

integer

Required. The height of the video in pixels. Must be an even integer. Valid range is [180, 1080].

frameRate

number

Required. The target video frame rate in frames per second (FPS). Must be less than or equal to 60. Will default to the input frame rate if larger than the input frame rate. The API will generate an output FPS that is divisible by the input FPS, and smaller or equal to the target FPS. See Calculating frame rate for more information.

bitrateBps

integer

Required. The video bitrate in bits per second. Minimum value is 10,000.

  • For SD resolution (< 720p), must be <= 3,000,000 (3 Mbps).
  • For HD resolution (<= 1080p), must be <= 15,000,000 (15 Mbps).
allowOpenGop

boolean

Specifies whether an open Group of Pictures (GOP) structure should be allowed or not. The default is false.

vbvSizeBits

integer

Size of the Video Buffering Verifier (VBV) buffer in bits. Must be greater than zero. The default is equal to bitrateBps.

vbvFullnessBits

integer

Initial fullness of the Video Buffering Verifier (VBV) buffer in bits. Must be greater than zero. The default is equal to 90% of vbvSizeBits.

entropyCoder

string

The entropy coder to use. The default is cabac.

Supported entropy coders:

  • cavlc
  • cabac
bPyramid

boolean

Allow B-pyramid for reference frame selection. This may not be supported on all decoders. The default is false.

bFrameCount

integer

The number of consecutive B-frames. Must be greater than or equal to zero. Must be less than gopFrameCount if set. The default is 0.

aqStrength

number

Specify the intensity of the adaptive quantizer (AQ). Must be between 0 and 1, where 0 disables the quantizer and 1 maximizes the quantizer. A higher value equals a lower bitrate but smoother image. The default is 0.

profile

string

Enforces the specified codec profile. The following profiles are supported:

  • baseline
  • main (default)
  • high

The available options are FFmpeg-compatible Profile Options. Note that certain values for this field may cause the transcoder to override other fields you set in the H264CodecSettings message.

tune

string

Enforces the specified codec tune. The available options are FFmpeg-compatible Encode Options Note that certain values for this field may cause the transcoder to override other fields you set in the H264CodecSettings message.

Union field gop_mode. GOP mode can be either by frame count or duration. gop_mode can be only one of the following:
gopFrameCount

integer

Select the GOP size based on the specified frame count. If GOP frame count is set instead of GOP duration, GOP duration will be calculated by gopFrameCount/frameRate. The calculated GOP duration must satisfy the limitations on gopDuration as well. Valid range is [60, 600].

gopDuration

string (Duration format)

Select the GOP size based on the specified duration. The default is 2s. Note that gopDuration must be less than or equal to segmentDuration, and segmentDuration must be divisible by gopDuration. Valid range is [2s, 20s].

All video streams in the same channel must have the same GOP size.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

AudioStream

Audio stream resource.

JSON representation
{
  "transmux": boolean,
  "codec": string,
  "bitrateBps": integer,
  "channelCount": integer,
  "channelLayout": [
    string
  ],
  "mapping": [
    {
      object (AudioMapping)
    }
  ],
  "sampleRateHertz": integer
}
Fields
transmux

boolean

Specifies whether pass through (transmuxing) is enabled or not. If set to true, the rest of the settings, other than mapping, will be ignored. The default is false.

codec

string

The codec for this audio stream. The default is aac.

Supported audio codecs:

  • aac
bitrateBps

integer

Required. Audio bitrate in bits per second. Must be between 1 and 10,000,000.

channelCount

integer

Number of audio channels. Must be between 1 and 6. The default is 2.

channelLayout[]

string

A list of channel names specifying layout of the audio channels. This only affects the metadata embedded in the container headers, if supported by the specified format. The default is [fl, fr].

Supported channel names:

  • fl - Front left channel
  • fr - Front right channel
  • sl - Side left channel
  • sr - Side right channel
  • fc - Front center channel
  • lfe - Low frequency
mapping[]

object (AudioMapping)

The mapping for the input streams and audio channels.

sampleRateHertz

integer

The audio sample rate in Hertz. The default is 48000 Hertz.

AudioMapping

The mapping for the input streams and audio channels.

JSON representation
{
  "inputKey": string,
  "inputTrack": integer,
  "inputChannel": integer,
  "outputChannel": integer
}
Fields
inputKey

string

Required. The Channel InputAttachment.key that identifies the input that this audio mapping applies to. If an active input doesn't have an audio mapping, the primary audio track in the input stream will be selected.

inputTrack

integer

Required. The zero-based index of the track in the input stream. All mappings in the same AudioStream must have the same input track.

inputChannel

integer

Required. The zero-based index of the channel in the input stream.

outputChannel

integer

Required. The zero-based index of the channel in the output audio stream. Must be consistent with the inputChannel.

TextStream

Encoding of a text stream. For example, closed captions or subtitles.

JSON representation
{
  "codec": string
}
Fields
codec

string

Required. The codec for this text stream.

Supported text codecs:

  • cea608
  • cea708

MuxStream

Multiplexing settings for output stream.

JSON representation
{
  "key": string,
  "container": string,
  "elementaryStreams": [
    string
  ],
  "segmentSettings": {
    object (SegmentSettings)
  }
}
Fields
key

string

A unique key for this multiplexed stream.

container

string

The container format. The default is fmp4.

Supported container formats:

  • fmp4 - the corresponding file extension is .m4s
  • ts - the corresponding file extension is .ts
elementaryStreams[]

string

List of ElementaryStream keys multiplexed in this stream.

  • For fmp4 container, must contain either one video or one audio stream.
  • For ts container, must contain exactly one audio stream and up to one video stream.
segmentSettings

object (SegmentSettings)

Segment settings for fmp4 and ts.

SegmentSettings

Segment settings for fmp4 and ts.

JSON representation
{
  "segmentDuration": string
}
Fields
segmentDuration

string (Duration format)

Duration of the segments in seconds. The default is 6s. Note that segmentDuration must be greater than or equal to gopDuration, and segmentDuration must be divisible by gopDuration. Valid range is [2s, 20s].

All muxStreams in the same manifest must have the same segment duration.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

Manifest

Manifest configuration.

JSON representation
{
  "fileName": string,
  "type": enum (ManifestType),
  "muxStreams": [
    string
  ],
  "maxSegmentCount": integer,
  "segmentKeepDuration": string
}
Fields
fileName

string

The name of the generated file. The default is manifest with the extension suffix corresponding to the Manifest type. If multiple manifests are added to the channel, each must have a unique file name.

type

enum (ManifestType)

Required. Type of the manifest, can be HLS or DASH.

muxStreams[]

string

Required. List of MuxStream keys that should appear in this manifest.

  • For HLS, either fmp4 or ts mux streams can be specified but not mixed.
  • For DASH, only fmp4 mux streams can be specified.
maxSegmentCount

integer

Maximum number of segments that this manifest holds. Once the manifest reaches this maximum number of segments, whenever a new segment is added to the manifest, the oldest segment will be removed from the manifest. The minimum value is 3 and the default value is 5.

segmentKeepDuration

string (Duration format)

How long to keep a segment on the output Google Cloud Storage bucket after it is removed from the manifest. This field should be large enough to cover the manifest propagation delay. Otherwise, a player could receive 404 errors while accessing segments which are listed in the manifest that the player has, but were already deleted from the output Google Cloud Storage bucket. Default value is 60s.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

ManifestType

The manifest type can be either HLS or DASH.

Enums
MANIFEST_TYPE_UNSPECIFIED The manifest type is not specified.
HLS Create an HLS manifest. The corresponding file extension is .m3u8.
DASH Create a DASH manifest. The corresponding file extension is .mpd.

SpriteSheet

Sprite sheet configuration.

JSON representation
{
  "format": string,
  "filePrefix": string,
  "spriteWidthPixels": integer,
  "spriteHeightPixels": integer,
  "columnCount": integer,
  "rowCount": integer,
  "interval": string,
  "quality": integer
}
Fields
format

string

Format type. The default is jpeg.

Supported formats:

  • jpeg
filePrefix

string

Required. File name prefix for the generated sprite sheets. If multiple sprite sheets are added to the channel, each must have a unique file prefix. Each sprite sheet has an incremental 10-digit zero-padded suffix starting from 0 before the extension, such as sprite_sheet0000000123.jpeg.

spriteWidthPixels

integer

Required. The width of the sprite in pixels. Must be an even integer.

spriteHeightPixels

integer

Required. The height of the sprite in pixels. Must be an even integer.

columnCount

integer

The maximum number of sprites per row in a sprite sheet. Valid range is [1, 10] and the default value is 1.

rowCount

integer

The maximum number of rows per sprite sheet. When the sprite sheet is full, a new sprite sheet is created. Valid range is [1, 10] and the default value is 1.

interval

string (Duration format)

Create sprites at regular intervals. Valid range is [1 second, 1 hour] and the default value is 10s.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

quality

integer

The quality of the generated sprite sheet. Enter a value between 1 and 100, where 1 is the lowest quality and 100 is the highest quality. The default is 100. A high quality value corresponds to a low image data compression ratio.

StreamingState

State of streaming operation that the channel is running.

Enums
STREAMING_STATE_UNSPECIFIED Streaming state is not specified.
STREAMING Channel is getting the input stream, generating the live streams to the specified output location.
AWAITING_INPUT Channel is waiting for the input stream through the input.
STREAMING_ERROR Channel is running, but has trouble publishing the live streams onto the specified output location (for example, the specified Cloud Storage bucket is not writable).
STREAMING_NO_INPUT Channel is generating live streams with no input stream. Live streams are filled out with black screen, while input stream is missing. Not supported yet.
STOPPED Channel is stopped, finishing live streams.
STARTING Channel is starting.
STOPPING Channel is stopping.

LogConfig

Configuration of platform logs. See Using and managing platform logs for more information about how to view platform logs through Cloud Logging.

JSON representation
{
  "logSeverity": enum (LogSeverity)
}
Fields
logSeverity

enum (LogSeverity)

The severity level of platform logging for this resource.

LogSeverity

The severity level of platform logging for this channel. Logs with a severity level higher than or equal to the chosen severity level will be logged and can be viewed through Cloud Logging. The severity level of a log is ranked as followed from low to high: DEBUG < INFO < NOTICE < WARNING < ERROR < CRITICAL < ALERT < EMERGENCY. See LogSeverity for more information.

Enums
LOG_SEVERITY_UNSPECIFIED Log severity is not specified. This is the same as log severity is OFF.
OFF Log is turned off.
DEBUG Log with severity higher than or equal to DEBUG are logged.
INFO Logs with severity higher than or equal to INFO are logged.
WARNING Logs with severity higher than or equal to WARNING are logged.
ERROR Logs with severity higher than or equal to ERROR are logged.

Methods

create

Creates a channel with the provided unique ID in the specified region.

delete

Deletes the specified channel.

get

Returns the specified channel.

list

Returns a list of all channels in the specified region.

patch

Updates the specified channel.

start

Starts the specified channel.

stop

Stops the specified channel.