Skip to content

create_channel async

create_channel(
    *,
    config_overrides: Optional[AsyncivsClientConfig] = None,
    name: Optional[ChannelName] = None,
    latency_mode: Optional[ChannelLatencyMode] = None,
    type: Optional[ChannelType] = None,
    authorized: Optional[Boolean] = None,
    recording_configuration_arn: Optional[ChannelRecordingConfigurationArn] = None,
    tags: Optional[Tags] = None,
    insecure_ingest: Optional[Boolean] = None,
    preset: Optional[TranscodePreset] = None,
    playback_restriction_policy_arn: Optional[
        ChannelPlaybackRestrictionPolicyArn
    ] = None,
    multitrack_input_configuration: Optional[MultitrackInputConfiguration] = None,
    container_format: Optional[ContainerFormat] = None,
    ad_configuration_arn: Optional[ChannelAdConfigurationArn] = None,
) -> CreateChannelResponse

Creates a new channel and an associated stream key to start streaming.

Parameters:

  • name (Optional[ChannelName], default: None ) –

    Channel name.

  • latency_mode (Optional[ChannelLatencyMode], default: None ) –

    Channel latency mode. Use NORMAL to broadcast and deliver live video up to Full HD. Use LOW for near-real-time interaction with viewers. Default: LOW.

  • type (Optional[ChannelType], default: None ) –

    Channel type, which determines the allowable resolution and bitrate. If you exceed the allowable input resolution or bitrate, the stream probably will disconnect immediately. Default: STANDARD. For details, see Channel Types.

  • authorized (Optional[Boolean], default: None ) –

    Whether the channel is private (enabled for playback authorization). Default: false.

  • recording_configuration_arn (Optional[ChannelRecordingConfigurationArn], default: None ) –

    Recording-configuration ARN. A valid ARN value here both specifies the ARN and enables recording. Default: "" (empty string, recording is disabled).

  • tags (Optional[Tags], default: None ) –

    Array of 1-50 maps, each of the form string:string (key:value). See Best practices and strategies in Tagging Amazon Web Services Resources and Tag Editor for details, including restrictions that apply to tags and "Tag naming limits and requirements"; Amazon IVS has no service-specific constraints beyond what is documented there.

  • insecure_ingest (Optional[Boolean], default: None ) –

    Whether the channel allows insecure RTMP and SRT ingest. Default: false.

  • preset (Optional[TranscodePreset], default: None ) –

    Optional transcode preset for the channel. This is selectable only for ADVANCED_HD and ADVANCED_SD channel types. For those channel types, the default preset is HIGHER_BANDWIDTH_DELIVERY. For other channel types (BASIC and STANDARD), preset is the empty string ("").

  • playback_restriction_policy_arn (Optional[ChannelPlaybackRestrictionPolicyArn], default: None ) –

    Playback-restriction-policy ARN. A valid ARN value here both specifies the ARN and enables playback restriction. Default: "" (empty string, no playback restriction policy is applied).

  • multitrack_input_configuration (Optional[MultitrackInputConfiguration], default: None ) –

    Object specifying multitrack input configuration. Default: no multitrack input configuration is specified.

  • container_format (Optional[ContainerFormat], default: None ) –

    Indicates which content-packaging format is used (MPEG-TS or fMP4). If multitrackInputConfiguration is specified and enabled is true, then containerFormat is required and must be set to FRAGMENTED_MP4. Otherwise, containerFormat may be set to TS or FRAGMENTED_MP4. Default: TS.

  • ad_configuration_arn (Optional[ChannelAdConfigurationArn], default: None ) –

    ARN of the ad configuration associated with the channel.

Raises:

Source code in docs_src/capo_ivs/_services/async_ivs.py
async def create_channel(
    self,
    *,
    config_overrides: Optional[AsyncivsClientConfig] = None,
    name: Optional["capo_ivs.types.channel_name.ChannelName"] = None,
    latency_mode: Optional[
        "capo_ivs.types.channel_latency_mode.ChannelLatencyMode"
    ] = None,
    type: Optional["capo_ivs.types.channel_type.ChannelType"] = None,
    authorized: Optional["capo_ivs.types.boolean.Boolean"] = None,
    recording_configuration_arn: Optional[
        "capo_ivs.types.channel_recording_configuration_arn.ChannelRecordingConfigurationArn"
    ] = None,
    tags: Optional["capo_ivs.types.tags.Tags"] = None,
    insecure_ingest: Optional["capo_ivs.types.boolean.Boolean"] = None,
    preset: Optional["capo_ivs.types.transcode_preset.TranscodePreset"] = None,
    playback_restriction_policy_arn: Optional[
        "capo_ivs.types.channel_playback_restriction_policy_arn.ChannelPlaybackRestrictionPolicyArn"
    ] = None,
    multitrack_input_configuration: Optional[
        "capo_ivs.types.multitrack_input_configuration.MultitrackInputConfiguration"
    ] = None,
    container_format: Optional[
        "capo_ivs.types.container_format.ContainerFormat"
    ] = None,
    ad_configuration_arn: Optional[
        "capo_ivs.types.channel_ad_configuration_arn.ChannelAdConfigurationArn"
    ] = None,
) -> "capo_ivs.types.create_channel_response.CreateChannelResponse":
    """<p>Creates a new channel and an associated stream key to start streaming.</p>

    Args:
        name: <p>Channel name.</p>
        latency_mode: <p>Channel latency mode. Use <code>NORMAL</code> to broadcast and deliver live video up to Full HD. Use <code>LOW</code> for near-real-time interaction with viewers. Default: <code>LOW</code>.</p>
        type: <p>Channel type, which determines the allowable resolution and bitrate. <i>If you exceed the allowable input resolution or bitrate, the stream probably will disconnect immediately.</i> Default: <code>STANDARD</code>. For details, see <a href="https://docs.aws.amazon.com/ivs/latest/LowLatencyUserGuide/channel-types.html">Channel Types</a>.</p>
        authorized: <p>Whether the channel is private (enabled for playback authorization). Default: <code>false</code>.</p>
        recording_configuration_arn: <p>Recording-configuration ARN. A valid ARN value here both specifies the ARN and enables recording. Default: "" (empty string, recording is disabled).</p>
        tags: <p>Array of 1-50 maps, each of the form <code>string:string (key:value)</code>. See <a href="https://docs.aws.amazon.com/tag-editor/latest/userguide/best-practices-and-strats.html">Best practices and strategies</a> in <i>Tagging Amazon Web Services Resources and Tag Editor</i> for details, including restrictions that apply to tags and "Tag naming limits and requirements"; Amazon IVS has no service-specific constraints beyond what is documented there.</p>
        insecure_ingest: <p>Whether the channel allows insecure RTMP and SRT ingest. Default: <code>false</code>.</p>
        preset: <p>Optional transcode preset for the channel. This is selectable only for <code>ADVANCED_HD</code> and <code>ADVANCED_SD</code> channel types. For those channel types, the default <code>preset</code> is <code>HIGHER_BANDWIDTH_DELIVERY</code>. For other channel types (<code>BASIC</code> and <code>STANDARD</code>), <code>preset</code> is the empty string (<code>""</code>).</p>
        playback_restriction_policy_arn: <p>Playback-restriction-policy ARN. A valid ARN value here both specifies the ARN and enables playback restriction. Default: "" (empty string, no playback restriction policy is applied).</p>
        multitrack_input_configuration: <p>Object specifying multitrack input configuration. Default: no multitrack input configuration is specified.</p>
        container_format: <p>Indicates which content-packaging format is used (MPEG-TS or fMP4). If <code>multitrackInputConfiguration</code> is specified and <code>enabled</code> is <code>true</code>, then <code>containerFormat</code> is required and must be set to <code>FRAGMENTED_MP4</code>. Otherwise, <code>containerFormat</code> may be set to <code>TS</code> or <code>FRAGMENTED_MP4</code>. Default: <code>TS</code>.</p>
        ad_configuration_arn: <p>ARN of the ad configuration associated with the channel.</p>

    Raises:
        capo_ivs.errors.access_denied_exception.AccessDeniedException: <p>User does not have sufficient access to perform this action.</p>
        capo_ivs.errors.pending_verification.PendingVerification: <p>Your account is pending verification.</p>
        capo_ivs.errors.resource_not_found_exception.ResourceNotFoundException: <p>Request references a resource which does not exist.</p>
        capo_ivs.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>Request would cause a service quota to be exceeded.</p>
        capo_ivs.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_ivs.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ivs.types.create_channel_request.CreateChannelRequest]",
    ) -> AsyncOperationResponse[
        "capo_ivs.types.create_channel_response.CreateChannelResponse"
    ]:
        import capo_ivs._operations.amazon_interactive_video_service.create_channel

        (
            output,
            http_response,
        ) = await capo_ivs._operations.amazon_interactive_video_service.create_channel.async_create_channel(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_ivs.types.create_channel_response.CreateChannelResponse",
    ) -> dict[str, Any]:
        import capo_ivs.types.create_channel_response

        return capo_ivs.types.create_channel_response.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateChannel", redact_output=_redact_output),
    )
    input_: capo_ivs.types.create_channel_request.CreateChannelRequest = {}
    if name is not None:
        input_["name"] = name
    if latency_mode is not None:
        input_["latency_mode"] = latency_mode
    if type is not None:
        input_["type"] = type
    if authorized is not None:
        input_["authorized"] = authorized
    if recording_configuration_arn is not None:
        input_["recording_configuration_arn"] = recording_configuration_arn
    if tags is not None:
        input_["tags"] = tags
    if insecure_ingest is not None:
        input_["insecure_ingest"] = insecure_ingest
    if preset is not None:
        input_["preset"] = preset
    if playback_restriction_policy_arn is not None:
        input_["playback_restriction_policy_arn"] = playback_restriction_policy_arn
    if multitrack_input_configuration is not None:
        input_["multitrack_input_configuration"] = multitrack_input_configuration
    if container_format is not None:
        input_["container_format"] = container_format
    if ad_configuration_arn is not None:
        input_["ad_configuration_arn"] = ad_configuration_arn

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output