예제 #1
0
파일: _utils.py 프로젝트: jim-minter/azhack
def create_ip_range(resource_name, ip):
    from azure.mgmt.media.models import IPRange
    subnet_prefix_length = None
    try:
        if '/' in ip:
            ipSplit = ip.split('/')
            ip = ipSplit[0]
            subnet_prefix_length = ipSplit[1]
    except ValueError:
        pass
    return IPRange(name=("{}_{}".format(resource_name, ip)),
                   address=ip,
                   subnet_prefix_length=subnet_prefix_length)
예제 #2
0
# 4) Understand the available Standby mode and how it differs from the Running Mode.
# 5) Understand the differences between a LiveOutput and the Asset that it records to.  They are two different concepts.
#    A live output can be considered as the "tape recorder" and the Asset is the tape that is inserted into it for recording.
# 6) Understand the advanced options such as low latency, and live transcription/captioning support.
#    Live Transcription - https://docs.microsoft.com/en-us/azure/media-services/latest/live-transcription
#    Low Latency - https://docs.microsoft.com/en-us/azure/media-services/latest/live-event-latency

# When broadcasting to a live event, please use one of the verified on-premises live streaminf encoders.
# While operating this tutorial, it is recommended to start out using OBS Studio before moving to another encoder.

# Note: When creating a LiveEvent, you can specify allowed IP addresses in one of the following formats:
#       IPV4 address with 4 numbers
#       CIDR address range

allow_all_input_range = IPRange(name="AllowAll",
                                address="0.0.0.0",
                                subnet_prefix_length=0)

# Create the LiveEvent input IP access control object
# This will control the IP that the encoder is running on and restrict access to only that encoder IP range.
# re-use the same range here for the sample, but in production, you can lock this down to the IP range for your on-premises
# live encoder, laptop, or device that is sending the live stream
live_event_input_access = LiveEventInputAccessControl(ip=IPAccessControl(
    allow=[allow_all_input_range]))

# Create the LiveEvent Preview IP access control object.
# This will restrict which clients can view the preview endpoint
# re-use the same range here for the sample, but in production, you can lock this to the IPs of your
# devices that would be monitoring the live preview.
live_event_preview = LiveEventPreview(
    access_control=LiveEventPreviewAccessControl(ip=IPAccessControl(