Пример #1
0
def tivo_compatible_video(vInfo, tsn, mime=''):
    message = (True, '')
    while True:
        codec = vInfo.get('vCodec', '')
        is4k = config.is4Ktivo(tsn) and codec == 'hevc'
        if mime == 'video/mp4':
            if not (is4k or codec == 'h264'):
                message = (False, 'vCodec %s not compatible' % codec)

            break

        if mime == 'video/bif':
            if codec != 'vc1':
                message = (False, 'vCodec %s not compatible' % codec)

            break

        if mime == 'video/x-tivo-mpeg-ts':
            if not (is4k or codec in ('h264', 'mpeg2video')):
                message = (False, 'vCodec %s not compatible' % codec)

            break

        if codec not in ('mpeg2video', 'mpeg1video'):
            message = (False, 'vCodec %s not compatible' % codec)
            break

        if vInfo['kbps'] != None:
            abit = max('0', vInfo['aKbps'])
            if (int(vInfo['kbps']) - int(abit) >
                config.strtod(config.getMaxVideoBR(tsn)) / 1000):
                message = (False, '%s kbps exceeds max video bitrate' %
                                  vInfo['kbps'])
                break
        else:
            message = (False, '%s kbps not supported' % vInfo['kbps'])
            break

        if config.isHDtivo(tsn):
            # HD Tivo detected, skipping remaining tests.
            break

        if not vInfo['vFps'] in ['29.97', '59.94']:
            message = (False, '%s vFps, should be 29.97' % vInfo['vFps'])
            break

        if ((config.get169Blacklist(tsn) and not config.get169Setting(tsn))
            or (config.get169Letterbox(tsn) and config.get169Setting(tsn))):
            if vInfo['dar1'] and vInfo['dar1'] not in ('4:3', '8:9', '880:657'):
                message = (False, ('DAR %s not supported ' +
                                   'by BLACKLIST_169 tivos') % vInfo['dar1'])
                break

        mode = (vInfo['vWidth'], vInfo['vHeight'])
        if mode not in [(720, 480), (704, 480), (544, 480),
                        (528, 480), (480, 480), (352, 480), (352, 240)]:
            message = (False, '%s x %s not in supported modes' % mode)
        break

    return message
Пример #2
0
def tivo_compatible_video(vInfo, tsn, mime=""):
    message = (True, "")
    while True:
        codec = vInfo.get("vCodec", "")
        is4k = config.is4Ktivo(tsn) and codec == "hevc"
        if mime == "video/mp4":
            if not (is4k or codec == "h264"):
                message = (False, "vCodec %s not compatible" % codec)

            break

        if mime == "video/bif":
            if codec != "vc1":
                message = (False, "vCodec %s not compatible" % codec)

            break

        if mime == "video/x-tivo-mpeg-ts":
            if not (is4k or codec in ("h264", "mpeg2video")):
                message = (False, "vCodec %s not compatible" % codec)

            break

        if codec not in ("mpeg2video", "mpeg1video"):
            message = (False, "vCodec %s not compatible" % codec)
            break

        if vInfo["kbps"] != None:
            abit = max("0", vInfo["aKbps"])
            if int(vInfo["kbps"]) - int(abit) > config.strtod(config.getMaxVideoBR(tsn)) / 1000:
                message = (False, "%s kbps exceeds max video bitrate" % vInfo["kbps"])
                break
        else:
            message = (False, "%s kbps not supported" % vInfo["kbps"])
            break

        if config.isHDtivo(tsn):
            # HD Tivo detected, skipping remaining tests.
            break

        if not vInfo["vFps"] in ["29.97", "59.94"]:
            message = (False, "%s vFps, should be 29.97" % vInfo["vFps"])
            break

        if (config.get169Blacklist(tsn) and not config.get169Setting(tsn)) or (
            config.get169Letterbox(tsn) and config.get169Setting(tsn)
        ):
            if vInfo["dar1"] and vInfo["dar1"] not in ("4:3", "8:9", "880:657"):
                message = (False, ("DAR %s not supported " + "by BLACKLIST_169 tivos") % vInfo["dar1"])
                break

        mode = (vInfo["vWidth"], vInfo["vHeight"])
        if mode not in [(720, 480), (704, 480), (544, 480), (528, 480), (480, 480), (352, 480), (352, 240)]:
            message = (False, "%s x %s not in supported modes" % mode)
        break

    return message
Пример #3
0
def tivo_compatible_video(vInfo, tsn, mime=''):
    message = (True, '')
    while True:
        codec = vInfo.get('vCodec', '')
        is4k = config.is4Ktivo(tsn) and codec == 'hevc'
        if mime == 'video/x-tivo-mpeg-ts':
            if not (is4k or codec in ('h264', 'mpeg2video')):
                message = (False, 'vCodec %s not compatible' % codec)

            break

        if codec not in ('mpeg2video', 'mpeg1video'):
            message = (False, 'vCodec %s not compatible' % codec)
            break

        if vInfo['kbps'] != None:
            abit = max('0', vInfo['aKbps'])
            if (int(vInfo['kbps']) - int(abit) >
                    config.strtod(config.getMaxVideoBR(tsn)) / 1000):
                message = (False,
                           '%s kbps exceeds max video bitrate' % vInfo['kbps'])
                break
        else:
            message = (False, '%s kbps not supported' % vInfo['kbps'])
            break

        if config.isHDtivo(tsn):
            # HD Tivo detected, skipping remaining tests.
            break

        if not vInfo['vFps'] in ['29.97', '59.94']:
            message = (False, '%s vFps, should be 29.97' % vInfo['vFps'])
            break

        if ((config.get169Blacklist(tsn) and not config.get169Setting(tsn)) or
            (config.get169Letterbox(tsn) and config.get169Setting(tsn))):
            if vInfo['dar1'] and vInfo['dar1'] not in ('4:3', '8:9',
                                                       '880:657'):
                message = (
                    False,
                    ('DAR %s not supported ' + 'by BLACKLIST_169 tivos') %
                    vInfo['dar1'])
                break

        mode = (vInfo['vWidth'], vInfo['vHeight'])
        if mode not in [(720, 480), (704, 480), (544, 480), (528, 480),
                        (480, 480), (352, 480), (352, 240)]:
            message = (False, '%s x %s not in supported modes' % mode)
        break

    return message