Пример #1
0
def _create_stream(encoding, encoding_input, input_path, codec_configuration, stream_selection_mode, position):
    # type: (Encoding, Input, str, CodecConfiguration, StreamSelectionMode, int) -> Stream
    """
    Adds a video or audio stream to an encoding

    <p>API endpoint:
    https://bitmovin.com/docs/encoding/api-reference/sections/encodings#/Encoding/PostEncodingEncodingsStreamsByEncodingId

    :param encoding: The encoding to which the stream will be added
    :param encoding_input: The input resource providing the input file
    :param input_path: The path to the input file
    :param codec_configuration: The codec configuration to be applied to the stream
    """

    stream_input = StreamInput(
        input_id=encoding_input.id,
        input_path=input_path,
        selection_mode=stream_selection_mode,
        position=position
    )

    stream = Stream(
        input_streams=[stream_input],
        codec_config_id=codec_configuration.id
    )

    return bitmovin_api.encoding.encodings.streams.create(encoding_id=encoding.id, stream=stream)
Пример #2
0
def _create_stream(encoding, input_stream, codec_configuration):
    # type: (Encoding, InputStream, CodecConfiguration) -> Stream
    """
    Adds a video or audio stream to an encoding

    <p>API endpoint:
    https://bitmovin.com/docs/encoding/api-reference/sections/encodings#/Encoding/PostEncodingEncodingsStreamsByEncodingId

    :param encoding: The encoding to which the stream will be added
    :param input_stream: The inputStream resource providing the input file
    :param: codec_configuration: The codec configuration to be applied to the stream
    """

    stream_input = StreamInput(input_stream_id=input_stream.id)

    stream = Stream(input_streams=[stream_input],
                    codec_config_id=codec_configuration.id,
                    mode=StreamMode.STANDARD)

    return bitmovin_api.encoding.encodings.streams.create(
        encoding_id=encoding.id, stream=stream)