X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?a=blobdiff_plain;f=cis%2Fapi%2Fbase.py;h=9e4ea5eeeb798ef86719e9658c4f013fe78a1af6;hb=refs%2Fheads%2Fmaster;hp=b4e18a80f724fda810c9298b889f6670db11fe26;hpb=080b37a97e93691b3ba1c4aa3982a143167115a7;p=living-lab-site.git diff --git a/cis/api/base.py b/cis/api/base.py index b4e18a8..9e4ea5e 100644 --- a/cis/api/base.py +++ b/cis/api/base.py @@ -61,7 +61,7 @@ class BaseTranscoder: self.name = name - def transcode(self, container, a_codec=None, v_codec=None, + def transcode(self, container, extension=None, 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): """ @@ -117,16 +117,19 @@ class BaseTranscoder: 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 extension == None: + ext = self.tr_extension(container, (v_codec is not None)) + else: + ext = extension if ext is not None: self.output_file += '.' + ext - return self._transcode(self.tr_container(container), + return self._transcode(self.tr_container(container), ext, 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, + def _transcode(self, container, extension=None, 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): """ @@ -250,9 +253,9 @@ class BaseThumbExtractor: output_file_name = os.path.join(self.dest_path, self.name) \ + '_t' + ("%02d" % index) + '.jpg' - if os.path.exists(output_file_name): - raise cis_exceptions.FileAlreadyExistsException( \ - 'file "%s" already exists' % output_file_name) + #if os.path.exists(output_file_name): + #raise cis_exceptions.FileAlreadyExistsException( \ + #'file "%s" already exists' % output_file_name) return output_file_name