+ if v_framerate is not None and type(v_framerate) is not int:
+ raise TypeError('Video frate rate must be an integer.')
+
+ if v_resolution is not None \
+ and re.match('[\d]+x[\d]+', v_resolution) is None:
+ raise ValueError('Video resolution must be a string like <width>x<height>.')
+
+ if v_dar is not None and (type(v_dar) is not float \
+ and re.match('[\d]+:[\d]+', v_dar) is None):
+ raise ValueError('Video display aspect ratio must be a float or a string like <den>:<num>.')
+
+ self.output_file = self.dest_path + self.name
+ if v_resolution is not None:
+ self.output_file += '_'
+ self.output_file += v_resolution[(v_resolution.rindex('x')+1):]
+ self.output_file += 'p'
+ ext = self.tr_extension(container, (v_codec is not None))
+ if ext is not None:
+ self.output_file += '.' + ext
+
+ self._transcode(self.tr_container(container),
+ self.tr_a_codec(a_codec), self.tr_v_codec(v_codec),
+ a_bitrate, a_samplingrate, a_channels,
+ v_bitrate, v_framerate, v_resolution, v_dar)
+
+ def _transcode(self, container, a_codec=None, v_codec=None,
+ a_bitrate=None, a_samplingrate=None, a_channels=None,
+ v_bitrate=None, v_framerate=None, v_resolution=None, v_dar=None):
+ """
+ Called by transcode; must be overridden by a child class which
+ effectively transcodes the input file.
+ """