gmyth-stream/server/0.3/plugins/transcoders/mencoder.py
branchtrunk
changeset 736 1bc4c47e4ad8
parent 735 15a191556cd6
child 737 fe8df7fd5229
     1.1 --- a/gmyth-stream/server/0.3/plugins/transcoders/mencoder.py	Fri Jun 01 11:50:11 2007 +0100
     1.2 +++ b/gmyth-stream/server/0.3/plugins/transcoders/mencoder.py	Fri Jun 01 13:48:21 2007 +0100
     1.3 @@ -88,8 +88,8 @@
     1.4  
     1.5          if self.args["mux"] == "mpeg":
     1.6              video += " -mpegopts format=%s" % self.args["format"]
     1.7 +
     1.8          video += " -vf scale=%s:%s" % (self.args["width"], self.args["height"])
     1.9 -
    1.10          return video
    1.11      # _setup_video()
    1.12  
    1.13 @@ -149,10 +149,27 @@
    1.14                  self.args["input"] = "file://%s" % self.args["input"]
    1.15  
    1.16          elif _type == "dvd":
    1.17 -            self.args["input"] = "dvd://".join(self.args["input"])
    1.18 +            self.args["input"] = "dvd://%s" % self.args["input"]
    1.19  
    1.20          elif _type == "myth":
    1.21              self.args["gmyth-cat"] = mythtv._setup_mythfilename(self)
    1.22 +
    1.23 +        elif _type == "tv":
    1.24 +            driver = self.params_first("driver", "v4l2")
    1.25 +            norm = self.params_first("norm", "pal-m")
    1.26 +            channel = self.params_first("channel", "13")
    1.27 +            chanlist = self.params_first("chanlist", "us-bcast")
    1.28 +            outfmt = self.params_first("outfmt", "yuy2")
    1.29 +            vdev = self.params_first("vdev", "/dev/video0")
    1.30 +            adev = self.params_first("adev", "/dev/dsp")
    1.31 +            print "teste1"
    1.32 +            self.args["input"] = "tv:// -v -tv driver=%s:norm=%s:channel=%s:" \
    1.33 +                                 "chanlist=%s:width=%s:height=%s:outfmt=%s:" \
    1.34 +                                 "device=%s:adevice=%s" % (driver, norm,
    1.35 +                                                           channel, chanlist,
    1.36 +                                                           self.args["width"],
    1.37 +                                                           self.args["height"],
    1.38 +                                                           outfmt, vdev, adev)
    1.39      # _setup_filename()
    1.40  
    1.41  
    1.42 @@ -231,6 +248,7 @@
    1.43          return True
    1.44      # _start_outfile()
    1.45  
    1.46 +
    1.47      def _start(self, outfd):
    1.48          # Play a file on disk or DVD
    1.49          if not self._run_mencoder(output=subprocess.PIPE):
    1.50 @@ -263,12 +281,11 @@
    1.51          cmd = " ".join(self.mencoder_opts)
    1.52          self.log.debug(self.tid, "Plugin's tid: %s" % self.tid)
    1.53          self.log.debug(self.tid, "Mencoder: %s" % cmd)
    1.54 -        #fixme
    1.55  
    1.56          ret = False
    1.57  
    1.58          if self.args["outfile"] == "-" and \
    1.59 -               self.args["type"] in ["file", "dvd"]:
    1.60 +               self.args["type"] in ["file", "dvd", "tv"]:
    1.61              ret = self._start(outfd)
    1.62  
    1.63          elif self.args["type"] == "myth":