gmyth-stream/server/plugins/transcoders/mencoder.py
branchtrunk
changeset 923 337aef39e86a
parent 832 daa61fffb811
     1.1 --- a/gmyth-stream/server/plugins/transcoders/mencoder.py	Wed Aug 29 14:42:10 2007 +0100
     1.2 +++ b/gmyth-stream/server/plugins/transcoders/mencoder.py	Mon Feb 25 14:14:29 2008 +0000
     1.3 @@ -42,7 +42,6 @@
     1.4          self.args["local"]    = params_first("local", False)
     1.5          self.args["language"] = params_first("language", False)
     1.6          self.args["subtitle"] = params_first("subtitle", False)
     1.7 -        self.args["format"]   = params_first("format", "mpeg1")
     1.8          self.args["outfile"]  = params_first("outfile", "-")
     1.9  
    1.10          # input_opt
    1.11 @@ -50,16 +49,15 @@
    1.12          self.args["input"]    = params_first("uri", "-")
    1.13  
    1.14          # audio_opts
    1.15 -        self.args["acodec"]   = params_first("acodec", "mp2")
    1.16 -        self.args["abitrate"] = params_first("abitrate", 192)
    1.17 -        self.args["volume"]   = params_first("volume", 5)
    1.18 +        self.args["acodec"]   = params_first("acodec", "mp3lame")
    1.19 +        self.args["abitrate"] = params_first("abitrate", 128)
    1.20 +        self.args["volume"]   = params_first("volume", 9)
    1.21  
    1.22          # video_opts
    1.23 -        self.args["mux"]      = params_first("mux", "mpeg")
    1.24          self.args["fps"]      = params_first("fps", 25)
    1.25 -        self.args["vcodec"]   = params_first("vcodec", "mpeg1video")
    1.26 -        self.args["vbitrate"] = params_first("vbitrate", 400)
    1.27 -        self.args["width"]    = params_first("width", 320)
    1.28 +        self.args["vcodec"]   = params_first("vcodec", "msmpeg4v2")
    1.29 +        self.args["vbitrate"] = params_first("vbitrate", 500)
    1.30 +        self.args["width"]    = params_first("width", 400)
    1.31          self.args["height"]   = params_first("height", 240)
    1.32      # _setup_params()
    1.33  
    1.34 @@ -77,20 +75,17 @@
    1.35  
    1.36  
    1.37      def _setup_video(self):
    1.38 -        video = " -of %s" % self.args["mux"]
    1.39 -        video += " -ofps %s" % self.args["fps"]
    1.40 +        #video = " -of %s" % self.args["mux"]
    1.41 +        video = " -ofps %s" % self.args["fps"]
    1.42  
    1.43          vcodec = self.args["vcodec"]
    1.44          if vcodec == "nuv" or vcodec == "xvid"\
    1.45                 or vcodec == "qtvideo" or vcodec == "copy":
    1.46              video += " -ovc %s" % vcodec
    1.47          else:
    1.48 -            video += " -ovc lavc -lavcopts vcodec=%s:vbitrate=%s" % (
    1.49 +            video += " -ovc lavc -lavcopts vcodec=%s:vhq:vbitrate=%s" % (
    1.50                  vcodec, self.args["vbitrate"])
    1.51  
    1.52 -        if self.args["mux"] == "mpeg":
    1.53 -            video += " -mpegopts format=%s" % self.args["format"]
    1.54 -
    1.55          video += " -vf scale=%s:%s" % (self.args["width"], self.args["height"])
    1.56          return video
    1.57      # _setup_video()
    1.58 @@ -274,6 +269,7 @@
    1.59  
    1.60      def _run_mencoder(self, input=None, output=None):
    1.61          try:
    1.62 +            print self.mencoder_opts
    1.63              self.proc = subprocess.Popen(self.mencoder_opts, stdin=input,
    1.64                                           stdout=output, close_fds=True)
    1.65          except Exception, e: