rtmp test.
[toast/stream2beamer.git] / lagarde.py
index faf833fa3b824d4d32994ad14492a7899d27755b..05b2fe008489ff19077277e06be98f9cadebd70b 100755 (executable)
@@ -177,7 +177,6 @@ class WebRTCClient:
         if not pad.has_current_caps():
             log.info(pad, 'has no caps, ignoring')
             return
-
         caps = pad.get_current_caps()
         padsize = caps.get_size()
         for i in range(padsize):
@@ -186,7 +185,9 @@ class WebRTCClient:
             if name.startswith('video'):
                 q = Gst.ElementFactory.make('queue')
                 conv = Gst.ElementFactory.make('videoconvert')
-                sink = Gst.ElementFactory.make('intervideosink')
+                sink = Gst.ElementFactory.make('rtmpsink')
+                sink.props.location = 'rtmp://127.0.0.1:1935/cug'
+                # sink.props.location = 'rtmp://127.0.0.1:1936/cug'
                 self.pipe.add(q)
                 self.pipe.add(conv)
                 self.pipe.add(sink)
@@ -194,6 +195,10 @@ class WebRTCClient:
                 pad.link(q.get_static_pad('sink'))
                 q.link(conv)
                 conv.link(sink)
+                # self.pipe.set_state(Gst.State.PLAYING)
+                print(dir(Gst.DebugGraphDetails))
+                Gst.debug_bin_to_dot_data(element, Gst.DebugGraphDetails.ALL)
+
             elif name.startswith('audio'):
                 q = Gst.ElementFactory.make('queue')
                 conv = Gst.ElementFactory.make('audioconvert')
@@ -293,7 +298,7 @@ async def run(uri):
     try:
         events = Events()
 
-        rtsp = RtspServer()
+        rtsp = RtspServer()
         webrtc = WebRTCClient(events)
         signaling = SignalingClient(events, uri)
 
@@ -313,7 +318,7 @@ async def run(uri):
 
 
 def main():
-    logging.basicConfig(level=logging.INFO, format='%(asctime)-15s %(message)s')
+    logging.basicConfig(level=logging.DEBUG, format='%(asctime)-15s %(message)s')
     parser = argparse.ArgumentParser()
     parser.add_argument('--uri', default='wss://localhost:1234/ws_connect?id=cug',
                         help='Signalling server URI')