Exemple #1
0
def has_hevc_qsv_support():
    binary, version, codecs = mediafiles.find_ffmpeg()
    if not binary:
        return False

    # TODO also check for motion codec parameter support

    return 'hevc_qsv' in codecs.get('hevc', {}).get('encoders', set())
Exemple #2
0
def test_requirements():
    if not os.access(settings.CONF_PATH, os.W_OK):
        logging.fatal(
            'config directory "%s" does not exist or is not writable' %
            settings.CONF_PATH)
        sys.exit(-1)

    if not os.access(settings.RUN_PATH, os.W_OK):
        logging.fatal('pid directory "%s" does not exist or is not writable' %
                      settings.RUN_PATH)
        sys.exit(-1)

    if not os.access(settings.LOG_PATH, os.W_OK):
        logging.fatal('log directory "%s" does not exist or is not writable' %
                      settings.LOG_PATH)
        sys.exit(-1)

    if not os.access(settings.MEDIA_PATH, os.W_OK):
        logging.fatal(
            'media directory "%s" does not exist or is not writable' %
            settings.MEDIA_PATH)
        sys.exit(-1)

    if os.geteuid() != 0:
        if settings.SMB_SHARES:
            logging.fatal(_('smb-akcioj postulas radikajn privilegiojn'))
            sys.exit(-1)

    try:
        import tornado  # @UnusedImport

    except ImportError:
        logging.fatal(_('bonvolu instali tornado version 3.1 aŭ pli'))
        sys.exit(-1)

    try:
        import jinja2  # @UnusedImport

    except ImportError:
        logging.fatal(_('bonvolu instali jinja2'))
        sys.exit(-1)

    try:
        import PIL.Image  # @UnusedImport

    except ImportError:
        logging.fatal(_('bonvolu instali pillow aŭ PIL'))
        sys.exit(-1)

    try:
        import pycurl  # @UnusedImport

    except ImportError:
        logging.fatal(_('bonvolu instali pycurl'))
        sys.exit(-1)

    from motioneye import motionctl
    has_motion = motionctl.find_motion()[0] is not None

    from motioneye import mediafiles
    has_ffmpeg = mediafiles.find_ffmpeg() is not None

    has_v4lutils = v4l2ctl.find_v4l2_ctl() is not None

    if settings.SMB_SHARES and smbctl.find_mount_cifs() is None:
        logging.fatal('please install cifs-utils')
        sys.exit(-1)

    if not has_motion:
        logging.info('motion not installed')

    if not has_ffmpeg:
        if has_motion:
            logging.warning('you have motion installed, but no ffmpeg')

        else:
            logging.info('ffmpeg not installed')

    if not has_v4lutils:
        if has_motion:
            logging.warning('you have motion installed, but no v4l-utils')

        else:
            logging.info('v4l-utils not installed')