Exemple #1
0
 def __init__(self, name='openh264', formatter=None):
     self.name = name
     self.codecname = 'openh264'
     super(OpenH264Codec,
           self).__init__(name,
                          formatter=formatter
                          or encoder.OptionFormatter(prefix='-', infix=' '))
     self.extension = '264'
Exemple #2
0
 def __init__(self,
              name='ffmpeg-mpeg4',
              formatter=None):
   self.name = name
   self.codecname = 'mpeg4'
   self.extension = 'avi'
   super(FfmpegCodec, self).__init__(
     name,
     formatter=(formatter or encoder.OptionFormatter(prefix='-', infix=' ')))
Exemple #3
0
 def __init__(self, name='libavc', formatter=None):
     self.name = name
     self.codecname = 'libavc'
     super(LibavcCodec, self).__init__(
         name,
         formatter=(formatter
                    or encoder.OptionFormatter(prefix='--', infix=' ')))
     self.extension = 'avi'
     self.option_set = encoder.OptionSet(
         # Rate control. 0 = constant QP, 1 = storage, 2 = CBR high delay,
         # 3 = CBR low delay
         # 2 and 3 seems to drop frames - sometimes, but not always.
         # 3 is able to run out of memory.
         encoder.Option('rc', ['0', '1']), )
Exemple #4
0
 def __init__(self, name='openh264', formatter=None):
     self.name = name
     self.codecname = 'openh264'
     super(OpenH264Codec,
           self).__init__(name,
                          formatter=formatter
                          or encoder.OptionFormatter(prefix='-', infix=' '))
     self.extension = '264'
     self.option_set = encoder.OptionSet(
         # Rate control. -1 = off, 0 = quality, 1 = bitrate, 2 = buffer based
         # Default is set in config file by RCMode parameter to 0.
         # Only 0 and 1 really make sense when rate control is used to select
         # the bitrate target.
         encoder.Option('rc', ['0', '1']))
Exemple #5
0
 def __init__(self, name='x264', formatter=None):
     super(X264Codec, self).__init__(
         name,
         formatter=(formatter
                    or encoder.OptionFormatter(prefix='--', infix=' ')))
     self.extension = 'mkv'
     self.option_set = encoder.OptionSet(
         encoder.Option('preset', [
             'ultrafast', 'superfast', 'veryfast', 'faster', 'fast',
             'medium', 'slow', 'slower', 'veryslow', 'placebo'
         ]),
         encoder.Option('rc-lookahead', ['0', '30', '60']),
         encoder.Option('vbv-init', ['0.5', '0.8', '0.9']),
         encoder.Option('ref', ['1', '2', '3', '16']),
     )
Exemple #6
0
 def __init__(self, name='x264', formatter=None):
     super(X264Codec, self).__init__(
         name,
         formatter=(formatter
                    or encoder.OptionFormatter(prefix='--', infix=' ')))
     self.extension = 'mkv'
     self.option_set = encoder.OptionSet(
         encoder.Option('preset', [
             'ultrafast', 'superfast', 'veryfast', 'faster', 'fast',
             'medium', 'slow', 'slower', 'veryslow', 'placebo'
         ]),
         encoder.Option('rc-lookahead', ['0', '30', '60']),
         encoder.Option('vbv-init', ['0.5', '0.8', '0.9']),
         encoder.Option('ref', ['1', '2', '3', '16']),
         encoder.ChoiceOption(['use-vbv-maxrate']),
         encoder.Option('profile', ['baseline', 'main', 'high']),
         encoder.Option('tune', ['psnr', 'ssim']),
         encoder.DummyOption('vbv-maxrate'),
         encoder.DummyOption('vbv-bufsize'),
     )
Exemple #7
0
 def __init__(self):
     self.name = 'unittest'
     self.option_set = encoder.OptionSet()
     self.option_formatter = encoder.OptionFormatter(prefix='--', infix=':')
Exemple #8
0
 def test_Format(self):
     opts = encoder.OptionSet(encoder.ChoiceOption(['foo', 'bar']))
     self.assertEquals(
         '--foo', opts.Format('foo/bar', 'foo', encoder.OptionFormatter()))