# HG changeset patch # User morphbr # Date 1180695011 -3600 # Node ID 15a191556cd6caf5b95781711f57e29b63b7105f # Parent 258959fbb3ecff33eef8fc6e564e22514dee9357 [svn r741] * GMyth-Streamer - gmencoder outfile support diff -r 258959fbb3ec -r 15a191556cd6 gmyth-stream/server/0.3/plugins/transcoders/gmencoder.py --- a/gmyth-stream/server/0.3/plugins/transcoders/gmencoder.py Thu May 31 20:45:06 2007 +0100 +++ b/gmyth-stream/server/0.3/plugins/transcoders/gmencoder.py Fri Jun 01 11:50:11 2007 +0100 @@ -3,9 +3,10 @@ __author__ = "Renato Filho" __author_email__ = "renato.filho@indt.org.br" __license__ = "GPL" -__version__ = "0.1" +__version__ = "0.2" import os +import sys import shlex import signal import subprocess @@ -51,7 +52,14 @@ def start(self, outfd): self.opts.append (self.gmencoder_path) self._parser_params () - self._insert_param ("-o", "fd://%d" % outfd.fileno()) + + outfile = self.params_first("outfile", None) + + if outfile: + path = os.path.join(sys.path[0], ".transcoded", outfile) + self._insert_param("-o", "file://%s" % path) + else: + self._insert_param ("-o", "fd://%d" % outfd.fileno()) cmd = " ".join(self.opts) self.log.info(self.tid, "GMencoder: %s" % cmd) @@ -60,9 +68,13 @@ self.proc = subprocess.Popen(self.opts, stdin=subprocess.PIPE, stdout=subprocess.PIPE) except Exception, e: - self.log.error(self.tid, "Error executing GMencoder: %s" % e) + self.log.error(self.tid, "Error: executing GMencoder: %s" % e) + outfd.write("Error: GMencoder: %s" % e) return False + if outfile: + outfd.write("OK ") + try: while (self.proc and self.proc.poll() == None): r, w, x = select.select([self.proc.stdout], [], [], 0) @@ -75,6 +87,7 @@ self.log.error(self.tid, "Problems handling data: %s" % e) return False + self.log.info(self.tid, "OK: Done") return True # start() diff -r 258959fbb3ec -r 15a191556cd6 gmyth-stream/server/0.3/plugins/transcoders/mencoder.py --- a/gmyth-stream/server/0.3/plugins/transcoders/mencoder.py Thu May 31 20:45:06 2007 +0100 +++ b/gmyth-stream/server/0.3/plugins/transcoders/mencoder.py Fri Jun 01 11:50:11 2007 +0100 @@ -203,7 +203,6 @@ return False stdout = self._check_opened_file(stdw, _stdin) - outfd.write("OK ") try: