aboutsummaryrefslogtreecommitdiff
path: root/voctocore/experiments
diff options
context:
space:
mode:
authorMaZderMind <git@mazdermind.de>2015-06-02 12:16:55 +0200
committerMaZderMind <git@mazdermind.de>2015-06-02 12:16:55 +0200
commit117354649fc8e27a5ad5d1b158b4ce9f49114027 (patch)
tree9a9aeda4ff345afbcb651a7e85b01af17b7dfcec /voctocore/experiments
parent9646021beda08d5042e5d250f613bb426d4f9d82 (diff)
script to test minimal pipeline for a/v-sync issue
Diffstat (limited to 'voctocore/experiments')
-rwxr-xr-xvoctocore/experiments/avsync.py64
1 files changed, 64 insertions, 0 deletions
diff --git a/voctocore/experiments/avsync.py b/voctocore/experiments/avsync.py
new file mode 100755
index 0000000..91ac76d
--- /dev/null
+++ b/voctocore/experiments/avsync.py
@@ -0,0 +1,64 @@
+#!/usr/bin/python3
+import gi, time
+import socket
+
+# import GStreamer and GTK-Helper classes
+gi.require_version('Gst', '1.0')
+from gi.repository import GLib, Gst, GObject
+
+# init GObject before importing local classes
+GObject.threads_init()
+Gst.init(None)
+
+class Example:
+ def __init__(self):
+ self.mainloop = GObject.MainLoop()
+
+ self.src = Gst.parse_launch("""
+ tcpserversrc port=10000 !
+ matroskademux name=demux
+
+ demux. !
+ audio/x-raw,format=S16LE,channels=2,layout=interleaved,rate=48000,channel-mask=(bitmask)0x3 !
+ queue !
+ tee name=atee
+
+ atee. ! queue ! interaudiosink channel=audio_cam1_mixer
+ atee. ! queue ! interaudiosink channel=audio_cam1_mirror
+
+ demux. !
+ video/x-raw,format=I420,width=800,height=450,framerate=25/1 !
+ queue !
+ tee name=vtee
+
+ vtee. ! queue ! intervideosink channel=video_cam1_mixer
+ vtee. ! queue ! intervideosink channel=video_cam1_mirror
+ """)
+
+ self.sink = Gst.parse_launch("""
+ interaudiosrc channel=audio_cam1_mirror !
+ audio/x-raw,format=S16LE,channels=2,layout=interleaved,rate=48000,channel-mask=(bitmask)0x3 !
+ queue !
+ mux.
+
+ intervideosrc channel=video_cam1_mirror !
+ video/x-raw,format=I420,width=800,height=450,framerate=25/1 !
+ queue !
+ mux.
+
+ matroskamux
+ name=mux
+ streamable=true
+ writing-app=Voctomix-AVRawOutput !
+
+ tcpserversink port=11000
+ """)
+
+ def run(self):
+ self.src.set_state(Gst.State.PLAYING)
+ self.sink.set_state(Gst.State.PLAYING)
+ self.mainloop.run()
+
+
+example = Example()
+example.run()