[svn r497] - Updated gmyth-streamer mencoder, xmlrpc and client_ffmpeg trunk
authormorphbr
Wed Apr 04 00:10:15 2007 +0100 (2007-04-04)
branchtrunk
changeset 49263d9475228ac
parent 491 caee9846e779
child 493 32148e79242d
[svn r497] - Updated gmyth-streamer mencoder, xmlrpc and client_ffmpeg
gmyth-stream/server/plugins/comm/xmlrpc.py
gmyth-stream/server/plugins/media/mencoder.py
gmyth-stream/server/tests/client_ffmpeg.py
     1.1 --- a/gmyth-stream/server/plugins/comm/xmlrpc.py	Tue Apr 03 21:23:11 2007 +0100
     1.2 +++ b/gmyth-stream/server/plugins/comm/xmlrpc.py	Wed Apr 04 00:10:15 2007 +0100
     1.3 @@ -15,7 +15,8 @@
     1.4      def _methodHelp(self, method):
     1.5  
     1.6          if method == 'setup':
     1.7 -            return "Setup the Media: setup( filename, mux, vcodec, vbitrate, fps, acodec, abitrate, width, height, port"
     1.8 +            return "Setup the Media: setup( filename, mux, vcodec, vbitrate,"\
     1.9 +                   " fps, acodec, abitrate, width, height, port, options"
    1.10          elif method == 'play':
    1.11              return "Play the Media: play()"
    1.12          elif method == 'stop':
    1.13 @@ -30,10 +31,17 @@
    1.14              return ""
    1.15  
    1.16      def setup(self, filename, mux, vcodec, vbitrate,\
    1.17 -            fps, acodec, abitrate, width, height, port):
    1.18 +            fps, acodec, abitrate, width, height, port, options):
    1.19 +
    1.20 +        msg = "%s %s %s %s %s %s %s" % (filename, mux, vcodec, vbitrate,\
    1.21 +                                        fps, acodec, abitrate, width, height, port)
    1.22 +
    1.23 +        if len(options) > 0:
    1.24 +            for opt in options:
    1.25 +                msg += " %s" % opt
    1.26 +
    1.27          self.recv_pool.append("SETUP")
    1.28 -        self.recv_pool.append("%s %s %s %s %s %s %s" % (filename, mux, vcodec, vbitrate,\
    1.29 -                                                        fps, acodec, abitrate, width, height, port)
    1.30 +        self.recv_pool.append(msg)
    1.31          return self.sendMsg()
    1.32  
    1.33      def play(self):
     2.1 --- a/gmyth-stream/server/plugins/media/mencoder.py	Tue Apr 03 21:23:11 2007 +0100
     2.2 +++ b/gmyth-stream/server/plugins/media/mencoder.py	Wed Apr 04 00:10:15 2007 +0100
     2.3 @@ -37,12 +37,12 @@
     2.4                  if (self.acodec == "mp3lame"):
     2.5                      audio = "-oac mp3lame -lameopts cbr:br=%s vol=5" % self.abitrate
     2.6                  else:
     2.7 -                    audio = "-oac lavc -lavcopts acodec=%s abitrate=%s" % (\
     2.8 +                    audio = "-oac lavc -lavcopts acodec=%s:abitrate=%s" % (\
     2.9                          self.acodec, self.abitrate)
    2.10  
    2.11              if (opt == "file"):
    2.12                  self.kind = "file"
    2.13 -                self.args += " %s -mf fps=%s -of %s %s"\
    2.14 +                self.args += " %s -mf fps=%s -of %s -noodml %s"\
    2.15                               " -ovc lavc -lavcopts vcodec=%s:vbitrate=%s -vf scale=%s:%s"\
    2.16                               " -o %s 1> /dev/null 2> /dev/null" % (
    2.17                      self.filename, self.fps, self.mux, audio, self.vcodec,
     3.1 --- a/gmyth-stream/server/tests/client_ffmpeg.py	Tue Apr 03 21:23:11 2007 +0100
     3.2 +++ b/gmyth-stream/server/tests/client_ffmpeg.py	Wed Apr 04 00:10:15 2007 +0100
     3.3 @@ -24,21 +24,24 @@
     3.4      sys.exit(-1)
     3.5  
     3.6  
     3.7 -mplayer = os.popen("which mplayer").read().strip()
     3.8 -mplayer += " - 1> /dev/null"
     3.9 -pin, pout = os.popen2(mplayer)
    3.10 +#mplayer = os.popen("which mplayer").read().strip()
    3.11 +#mplayer += " - 1> /dev/null"
    3.12 +#pin, pout = os.popen2(mplayer)
    3.13 +
    3.14 +teste = open("/tmp/teste2", "w")
    3.15  
    3.16  data = socket.recv(1024)
    3.17  i = 0
    3.18  
    3.19  while (data != ""):
    3.20 -    pin.write(data)
    3.21 +    #pin.write(data)
    3.22 +    teste.write(data)
    3.23      data = socket.recv(1024)
    3.24      if (i == 500):
    3.25          socket.send("OK")
    3.26      i += 1
    3.27  
    3.28 -pin.close()
    3.29 +#pin.close()
    3.30  socket.close()
    3.31  
    3.32