示例#1
0
def _create_audio_media_playlist(encoding, manifest, audio_muxing,
                                 segment_path):
    # type: (Encoding, HlsManifest, Muxing, str) -> AudioMediaInfo
    """
    Creates an HLS audio media playlist

    :param encoding The encoding to which the manifest belongs to
    :param manifest: The manifest to which the playlist should be added
    :param audio_muxing: The audio muxing for which the playlist should be generated
    :param segment_path: The path containing the audio segments to be referenced by the playlist
    """

    audio_media_info = AudioMediaInfo(
        name="audio.m3u8",
        uri="audio.m3u8",
        group_id="audio",
        encoding_id=encoding.id,
        stream_id=audio_muxing.streams[0].stream_id,
        muxing_id=audio_muxing.id,
        language="en",
        assoc_language="en",
        autoselect=False,
        is_default=False,
        forced=False,
        segment_path=segment_path)

    return bitmovin_api.encoding.manifests.hls.media.audio.create(
        manifest_id=manifest.id, audio_media_info=audio_media_info)
示例#2
0
def _create_audio_media_playlist(encoding, manifest, audio_muxing,
                                 audio_stream, uri, segments_path,
                                 audio_group):
    # type: (Encoding, HlsManifest, Muxing, Stream, str, str, str) -> None
    """
    Creates an HLS audio media playlist.

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

    :param encoding: the encoding where the resources belong to
    :param manifest: the manifest where the audio playlist should be added
    :param audio_muxing: the audio muxing that should be used
    :param audio_stream: the audio stream of the muxing
    :param segments_path: the path to the audio segments
    """

    audio_media_info = AudioMediaInfo(name=uri,
                                      uri=uri,
                                      group_id=audio_group,
                                      encoding_id=encoding.id,
                                      stream_id=audio_stream.id,
                                      muxing_id=audio_muxing.id,
                                      language="en",
                                      assoc_language="en",
                                      autoselect=False,
                                      is_default=False,
                                      forced=False,
                                      segment_path=segments_path)

    bitmovin_api.encoding.manifests.hls.media.audio.create(
        manifest_id=manifest.id, audio_media_info=audio_media_info)
示例#3
0
def _add_hls_audio_media_info(manifest, encoding_id, muxing_id, stream_id,
                              relative_path, segment_path, language):
    audio_media = AudioMediaInfo(
        name="Audio Media Info for muxing {}".format(muxing_id),
        group_id='audio',
        segment_path=segment_path,
        encoding_id=encoding_id,
        stream_id=stream_id,
        muxing_id=muxing_id,
        language=language,
        uri='{}audio.m3u8'.format(relative_path))
    return manifest_api.hls.media.audio.create(manifest_id=manifest.id,
                                               audio_media_info=audio_media)