Пример #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))
Пример #2
0
def get_thumbnail_synchronous(filename, width, height, output, 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', convert_path_for_subprocess(filename),
		   '-vf', filter_, '-vframes', '1', output]
    try:
	execute.check_output(commandline)
    except execute.CalledProcessError, e:
	logger.exception('error calling %r\ncode:%s\noutput:%s',
			  commandline, e.returncode, e.output)
	return None
def get_thumbnail_synchronous(filename, width, height, output, 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',
        convert_path_for_subprocess(filename), '-vf', filter_, '-vframes', '1',
        output
    ]
    try:
        execute.check_output(commandline)
    except execute.CalledProcessError, e:
        logger.exception('error calling %r\ncode:%s\noutput:%s', commandline,
                         e.returncode, e.output)
        return None
Пример #4
0
def get_ffmpeg_output(filepath):

    commandline = [get_ffmpeg_executable_path(),
                   "-i", filepath]
    try:
        output = execute.check_output(commandline)
    except execute.CalledProcessError, e:
        if e.returncode != 1:
            logger.exception("error calling %r\noutput:%s", commandline,
                              e.output)
        # ffmpeg -i generally returns 1, so we ignore the exception and
        # just get the output.
        output = e.output
def get_ffmpeg_output(filepath):

    commandline = [
        get_ffmpeg_executable_path(), "-i",
        convert_path_for_subprocess(filepath)
    ]
    logging.info("get_ffmpeg_output(): running %s", commandline)
    try:
        output = execute.check_output(commandline)
    except execute.CalledProcessError, e:
        if e.returncode != 1:
            logger.exception("error calling %r\noutput:%s", commandline,
                             e.output)
        # ffmpeg -i generally returns 1, so we ignore the exception and
        # just get the output.
        output = e.output