[svn r770] * Changed mencoder to use chunck blocks trunk
authormorphbr
Sat Jun 30 14:16:59 2007 +0100 (2007-06-30)
branchtrunk
changeset 764823dad73a2c2
parent 763 4ac83e3152c0
child 765 57f3de326cd8
[svn r770] * Changed mencoder to use chunck blocks
gmyth-stream/server/0.3/plugins/transcoders/mencoder.py
gmyth-stream/server/0.3/plugins/transcoders/mencoder_lib/mythtv.py
     1.1 --- a/gmyth-stream/server/0.3/plugins/transcoders/mencoder.py	Sat Jun 30 00:27:43 2007 +0100
     1.2 +++ b/gmyth-stream/server/0.3/plugins/transcoders/mencoder.py	Sat Jun 30 14:16:59 2007 +0100
     1.3 @@ -23,6 +23,8 @@
     1.4  
     1.5  __all__ = ("TranscoderMencoder",)
     1.6  
     1.7 +buffer_size = 1024 * 64
     1.8 +
     1.9  class TranscoderMencoder(transcoder.Transcoder):
    1.10      """Transcoder class that implements a transcoder using Mencoder"""
    1.11      mencoder_path = utils.which("mencoder")
    1.12 @@ -118,8 +120,6 @@
    1.13              self._arg_append(args, "-slang %s" % self.args["subtitle"])
    1.14              self._arg_append(args, "-subfps %s" % self.args["fps"])
    1.15  
    1.16 -        self._arg_append(args, "-idx")
    1.17 -        self._arg_append(args, "-cache 1024")
    1.18          self._arg_append(args, self._setup_audio())
    1.19          self._arg_append(args, self._setup_video())
    1.20  
    1.21 @@ -198,7 +198,7 @@
    1.22              try:
    1.23                  return open(self.args["outfile"])
    1.24              except:
    1.25 -                os.write(stdw, _stdin.read(1024))
    1.26 +                os.write(stdw, _stdin.read(buffer_size))
    1.27      # _check_opened_file
    1.28  
    1.29  
    1.30 @@ -262,7 +262,7 @@
    1.31  
    1.32          try:
    1.33              while self.proc and self.proc.poll() == None:
    1.34 -                d = self.proc.stdout.read(1024)
    1.35 +                d = self.proc.stdout.read(buffer_size)
    1.36                  outfd.write(d)
    1.37          except Exception, e:
    1.38              self.log.error(self.tid, "Error: %s" % e)
     2.1 --- a/gmyth-stream/server/0.3/plugins/transcoders/mencoder_lib/mythtv.py	Sat Jun 30 00:27:43 2007 +0100
     2.2 +++ b/gmyth-stream/server/0.3/plugins/transcoders/mencoder_lib/mythtv.py	Sat Jun 30 14:16:59 2007 +0100
     2.3 @@ -7,6 +7,8 @@
     2.4  
     2.5  from select import select
     2.6  
     2.7 +buffer_size = 1024 * 64
     2.8 +
     2.9  def _setup_mythfilename(self):
    2.10      # mythtv:mythtv@192.168.3.110:6543/1002_20070426230000.nuv
    2.11      try:
    2.12 @@ -89,8 +91,10 @@
    2.13              r, w, x = select([self.gmyth.stderr, self.proc.stdout],
    2.14                               [], [], 0)
    2.15              if self.proc.stdout in r:
    2.16 -                d = self.proc.stdout.read(4096)
    2.17 +                d = self.proc.stdout.read(buffer_size)
    2.18 +                outfd.write("%x\r\n", len(d))
    2.19                  outfd.write(d)
    2.20 +                outfd.write("\r\n")
    2.21  
    2.22              if self.gmyth.stderr in r:
    2.23                  partial = self.gmyth.stderr.readline()
    2.24 @@ -98,6 +102,8 @@
    2.25                      self.status = utils.progress_bar(int(partial),
    2.26                                                       int(size), 50)
    2.27  
    2.28 +        outfd.write("0\r\n\r\n")
    2.29 +
    2.30      except IndexError, e:
    2.31          pass
    2.32      except Exception, e: