def check_ffmpeg_arguments(self, converter_id, correct_arguments):
        """Check the arguments of a ffmpeg-based converter."""
        converter = self.manager.converters[converter_id]
        self.assertEquals(converter.get_executable(),
                          settings.get_ffmpeg_executable_path())

        self.assertEquals(self.get_converter_arguments(converter),
                          correct_arguments)
def get_thumbnail(filename, width, height, output, skip=0):
    commandline = [get_ffmpeg_executable_path(),
                   '-ss', str(skip), '-i', filename, '-vf',
                   'thumbnail,scale=%i:%i' % (width, height),
                   '-frames', '1', output]

    try:
        subprocess.check_output(commandline,
                                stderr=subprocess.STDOUT)
    except subprocess.CalledProcessError, e:
        logging.exception('error calling %r\noutput:%s', commandline, e.output)
        return None
Beispiel #3
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
Beispiel #5
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
Beispiel #7
0
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:
    def check_ffmpeg_arguments(self, converter_id, correct_arguments):
        """Check the arguments of a ffmpeg-based converter."""
        converter = self.manager.converters[converter_id]
        self.assertEquals(converter.get_executable(), settings.get_ffmpeg_executable_path())

        self.assertEquals(self.get_converter_arguments(converter), correct_arguments)
 def get_executable(self):
     return settings.get_ffmpeg_executable_path()
Beispiel #10
0
 def get_executable(self):
     return settings.get_ffmpeg_executable_path()