def parse_file(filename):
    filename = make_unicode(filename)
    try:
        parser = createParser(filename)
    except InputStreamError, err:
        logger.error("stream error! %s\n" % unicode(err))
        return None
Example #2
0
def parse_file(filename):
    filename = make_unicode(filename)
    try:
        parser = createParser(filename)
    except InputStreamError, err:
        logger.error("stream error! %s\n" % unicode(err))
        return None
def extract(filename):
    """Extract the metadata from the media file"""

    filename = unicode(filename)

    try:
        parser = createParser(filename)
    except InputStreamError, err:
        logger.error("stream error! %s\n" % unicode(err))
        return None
Example #4
0
def metadata(objeto, key):
    uid = objeto.UID()
    registry = getUtility(IRegistry)
    global_settings = registry.forInterface(IStreamingSettings)
    path = global_settings.path
    file = path + uid + "_video.flv"
    parser = createParser(unicode(file))
    if parser is not None:
        metadata = extractMetadata(parser)
        if metadata is not None:
            if metadata.has(key):
                return metadata.get(key)
    return None
def extract(filename):
    """Extract the metadata from the media file"""

    from hachoir_parser.guess import createParser
    from hachoir_metadata.metadata import extractMetadata
    from hachoir_core.error import HachoirError
    from hachoir_core.stream import InputStreamError

    filename = unicode(filename)

    try:
        parser = createParser(filename)
    except InputStreamError, err:
        logger.warning("Stream error! %s" % unicode(err))
        return None
def extract(filename):
    """Extract the metadata from the media file"""

    from hachoir_parser.guess import createParser
    from hachoir_metadata.metadata import extractMetadata
    from hachoir_core.error import HachoirError
    from hachoir_core.stream import InputStreamError

    filename = unicode(filename)

    try:
        parser = createParser(filename)
    except InputStreamError, err:
        logger.warning("Stream error! %s" % unicode(err))
        return None
Example #7
0
def load_file(app, filename):
    parser = createParser(force_unicode(filename), real_filename = filename)
    if not parser:
        return
    new_window(app, open(filename, 'rb'), parser, filename)
Example #8
0
def load_file(app, filename):
    parser = createParser(force_unicode(filename), real_filename=filename)
    if not parser:
        return
    new_window(app, open(filename, 'rb'), parser, filename)