[svn r604] Generate coverage reports using lcov.
6 import lib.utils as utils
7 import lib.server as server
9 __all__ = ("TranscoderGMencoder",)
11 class TranscoderGMencoder(server.Transcoder):
12 gmencoder_path = utils.which("gmencoder")
17 def __init__(self, params):
18 server.Transcoder.__init__(self, params)
22 def _insert_param (self, name, value):
24 self.opts.append(name)
25 self.opts.append(value)
27 def _parser_params (self):
28 self._insert_param("-i", \
29 "%s://%s" % (self.params_first("uri_prefix", "file"), self.params_first("uri_path", "")))
31 #self._insert_param("-i", self.params_first("uri", ""))
33 self._insert_param("--video-encode", self.params_first("ve", ""))
34 self._insert_param("--video-opts", "bitrate=200,pass=2,quantizer=5")
35 self._insert_param("--video-fps", self.params_first("fps", ""))
36 self._insert_param("--video-width", self.params_first("width", ""))
37 self._insert_param("--video-height", self.params_first("height", ""))
38 self._insert_param("--audio-encode", self.params_first("ae", ""))
39 self._insert_param("--output-element", "fdsink")
42 def start(self, outfd):
43 self.opts.append (self.gmencoder_path)
44 self._parser_params ()
45 self.opts.append ("--output-opts")
46 self.opts.append ("fd=%d" % outfd.fileno())
48 cmd = " ".join(self.opts)
49 self.log.info ("GMencoder: %s", cmd)
52 self.proc = subprocess.Popen(self.opts, stdin=subprocess.PIPE)
54 self.log.error("Error executing GMencoder: %s" % e)
60 self.log.error("Problems handling data: %s" % e)
69 self.log.info ("STOPed GMencoder plugin")
71 self.proc.stdin.write ("QUIT\n")