Example #1
0
    def __init__(self, ffmpeg_path=None, ffprobe_path=None):
        """
        Initialize a new Converter object.
        """

        self.ffmpeg = FFMpeg(ffmpeg_path=ffmpeg_path,
                             ffprobe_path=ffprobe_path)
        self.video_codecs = {}
        self.audio_codecs = {}
        self.subtitle_codecs = {}
        self.attachment_codecs = {}
        self.formats = {}

        for cls in audio_codec_list:
            name = cls.codec_name
            self.audio_codecs[name] = cls

        for cls in video_codec_list:
            name = cls.codec_name
            self.video_codecs[name] = cls

        for cls in subtitle_codec_list:
            name = cls.codec_name
            self.subtitle_codecs[name] = cls

        for cls in attachment_codec_list:
            name = cls.codec_name
            self.attachment_codecs[name] = cls

        for cls in format_list:
            name = cls.format_name
            self.formats[name] = cls
Example #2
0
    def start(self):
        """
        Start encoding.

        :raises: :py:exc:`~encode.EncodeError` if something goes wrong
            during encoding.
        """
        command = shlex.split(self.profile.command)

        try:
            ffmpeg = FFMpeg(self.profile.encoder.path)
            job = ffmpeg.convert(self.input_path, self.output_path, command)
            for timecode in job:
                logger.debug("Encoding (time: %f)...\r" % timecode)

        except FFMpegError as error:
            exc = self._build_exception(error, self.profile.command)
            raise exc

        except FFMpegConvertError as error:
            exc = self._build_exception(error.details, self.profile.command)
            raise exc
Example #3
0
    def __init__(self, ffmpeg_path=None, ffprobe_path=None):
        '''Initialize a new Converter object.'''
        self.ffmpeg = FFMpeg(ffmpeg_path=ffmpeg_path,
                             ffprobe_path=ffprobe_path)
        self.video_codecs = {}
        self.audio_codecs = {}
        self.subtitle_codecs = {}
        self.formats = {}

        for cls in codec_lists['audio']:
            name = cls.codec_name
            self.audio_codecs[name] = cls

        for cls in codec_lists['video']:
            name = cls.codec_name
            self.video_codecs[name] = cls

        for cls in codec_lists['subtitle']:
            name = cls.codec_name
            self.subtitle_codecs[name] = cls

        for cls in format_list:
            name = cls.format_name
            self.formats[name] = cls