Exemple #1
0
 def run():
     try:
         execute.check_output(commandline)
     except execute.CalledProcessError, e:
         logger.exception('error calling %r\ncode:%s\noutput:%s',
                           commandline, e.returncode, e.output)
         idle_add(lambda: completion(None))
 def run():
     rv = get_thumbnail_synchronous(filename, width, height, output, skip)
     idle_add(lambda: completion(rv))
Exemple #3
0
    output = get_ffmpeg_output(filepath)
    ast = parse_ffmpeg_output(output.splitlines())
    info = extract_info(ast)
    logger.info('get_media_info: %r', info)
    return info

def get_thumbnail(filename, width, height, output, completion, skip=0):
    executable = get_ffmpeg_executable_path()
    filter_ = 'scale=%i:%i' % (width, height)
    # bz19571: temporary disable: libav ffmpeg does not support this filter
    #if 'ffmpeg' in executable:
    #    # supports the thumbnail filter, we hope
    #    filter_ = 'thumbnail,' + filter_
    commandline = [executable,
                   '-ss', str(skip), '-i', filename, '-vf', filter_,
                   '-vframes', '1', output]

    name = 'Thumbnail - %r @ %sx%s' % (filename, width, height)
    def run():
        try:
            execute.check_output(commandline)
        except execute.CalledProcessError, e:
            logger.exception('error calling %r\ncode:%s\noutput:%s',
                              commandline, e.returncode, e.output)
            idle_add(lambda: completion(None))
        else:
            idle_add(lambda: completion(output))

    t = threading.Thread(target=run, name=name)
    t.start()
Exemple #4
0
    def run():
	rv = get_thumbnail_synchronous(filename, width, height, output, skip)
	idle_add(lambda: completion(rv))