summaryrefslogtreecommitdiff
path: root/voctocore/experiments
diff options
context:
space:
mode:
Diffstat (limited to 'voctocore/experiments')
-rwxr-xr-xvoctocore/experiments/avsync.py64
-rwxr-xr-xvoctocore/experiments/intervideo.py74
-rwxr-xr-xvoctocore/experiments/sync-videomix.py94
-rwxr-xr-xvoctocore/experiments/test-audio.sh2
-rwxr-xr-xvoctocore/experiments/test-avsync.sh23
-rwxr-xr-xvoctocore/experiments/test-eevblog.sh22
-rwxr-xr-xvoctocore/experiments/test-video.sh2
7 files changed, 0 insertions, 281 deletions
diff --git a/voctocore/experiments/avsync.py b/voctocore/experiments/avsync.py
deleted file mode 100755
index 91ac76d..0000000
--- a/voctocore/experiments/avsync.py
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/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()
diff --git a/voctocore/experiments/intervideo.py b/voctocore/experiments/intervideo.py
deleted file mode 100755
index a3f49bf..0000000
--- a/voctocore/experiments/intervideo.py
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/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.source_pipeline = None
-
- video = True
- if video:
- self.pipeline1 = Gst.parse_launch("""
- videotestsrc !
- video/x-raw,width=800,height=450,format=I420,framerate=1/1 !
- intervideosink channel=video
- """)
-
- self.pipeline2 = Gst.parse_launch("""
- intervideosrc channel=video !
- video/x-raw,width=800,height=450,format=I420,framerate=1/1 !
- xvimagesink
- """)
-
- else:
- self.pipeline1 = Gst.parse_launch("""
- audiotestsrc !
- audio/x-raw,format=S16LE,channels=2,layout=interleaved,rate=48000,channel-mask=(bitmask)0x3 !
- interaudiosink channel=audio
- """)
-
- self.pipeline2 = Gst.parse_launch("""
- interaudiosrc channel=audio !
- audio/x-raw,format=S16LE,channels=2,layout=interleaved,rate=48000,channel-mask=(bitmask)0x3 !
- alsasink
- """)
-
- self.pipeline1.bus.add_signal_watch()
- self.pipeline1.bus.connect("message::eos", self.on_eos)
- self.pipeline1.bus.connect("message::error", self.on_error)
-
- self.pipeline2.bus.add_signal_watch()
- self.pipeline2.bus.connect("message::eos", self.on_eos)
- self.pipeline2.bus.connect("message::error", self.on_error)
-
- GLib.timeout_add_seconds(3, self.on_timeout)
-
- def run(self):
- print("starting pipeline2")
- self.pipeline2.set_state(Gst.State.PLAYING)
- self.mainloop.run()
-
- def on_timeout(self):
- print("starting pipeline1")
- self.pipeline1.set_state(Gst.State.PLAYING)
- return False
-
- def on_eos(self, bus, message):
- self.log.debug('Received End-of-Stream-Signal on Pipeline')
-
- def on_error(self, bus, message):
- self.log.debug('Received Error-Signal on Pipeline')
- (error, debug) = message.parse_error()
- self.log.debug('Error-Details: #%u: %s', error.code, debug)
-
-example = Example()
-example.run()
diff --git a/voctocore/experiments/sync-videomix.py b/voctocore/experiments/sync-videomix.py
deleted file mode 100755
index e496091..0000000
--- a/voctocore/experiments/sync-videomix.py
+++ /dev/null
@@ -1,94 +0,0 @@
-#!/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()
-
- pipeline = """
- videotestsrc pattern=red !
- {caps} !
- mix.
-
- videotestsrc pattern=green !
- {caps} !
- mix.
-
- compositor name=mix !
- {caps} !
- identity name=sig !
- videoconvert !
- pngenc !
- multifilesink location=frame%04d.png
- """.format(
- caps='video/x-raw,width=800,height=450,format=I420,framerate=25/1'
- )
-
- self.pipeline = Gst.parse_launch(pipeline)
-
- # with sync=False changes to videomixer & scaler are performed
- # from the main thread. In the frame-images it becomes clear, that
- # sometimes not all changes are applied before a frame is pushed
- # through the mixer, and so there are "half modified" frames where
- # some pieces are missing, the zorder or the size of one video is
- # incorrect
- # with sync=True all changes are made from the streaming-thread
- # that drives the videomixer and the following elements, so they
- # are always completed before the mixer processes the next frame
- sync = True
- if sync:
- sig = self.pipeline.get_by_name('sig')
- sig.connect('handoff', self.reconfigure)
- else:
- GLib.timeout_add(1/25 * 1000, self.reconfigure, 0, 0)
-
- self.pad0 = self.pipeline.get_by_name('mix').get_static_pad('sink_0')
- self.pad1 = self.pipeline.get_by_name('mix').get_static_pad('sink_1')
-
- self.state = False
-
- def reconfigure(self, object, buffer):
- print("reconfigure!")
- if self.state:
- padA = self.pad0
- padB = self.pad1
- else:
- padA = self.pad1
- padB = self.pad0
-
- padA.set_property('xpos', 10)
- padA.set_property('ypos', 10)
- padA.set_property('alpha', 1.0)
- padA.set_property('zorder', 1)
- padA.set_property('width', 0)
- padA.set_property('height', 0)
-
- padB.set_property('xpos', 310)
- padB.set_property('ypos', 170)
- padB.set_property('alpha', 1.0)
- padB.set_property('zorder', 2)
- padB.set_property('width', 480)
- padB.set_property('height', 270)
-
- self.state = not self.state
- return True
-
- def run(self):
- self.pipeline.set_state(Gst.State.PLAYING)
- self.mainloop.run()
-
- def kill(self):
- self.pipeline.set_state(Gst.State.NULL)
- self.mainloop.quit()
-
-example = Example()
-example.run()
diff --git a/voctocore/experiments/test-audio.sh b/voctocore/experiments/test-audio.sh
deleted file mode 100755
index bd51bb8..0000000
--- a/voctocore/experiments/test-audio.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-gst-launch-1.0 audiotestsrc ! audio/x-raw,format=S16LE,layout=interleaved,rate=48000,channels=2 ! gdppay ! tcpclientsink host=localhost port=6000
diff --git a/voctocore/experiments/test-avsync.sh b/voctocore/experiments/test-avsync.sh
deleted file mode 100755
index 63e9a9b..0000000
--- a/voctocore/experiments/test-avsync.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-gst-launch-1.0 -vm \
- uridecodebin \
- uri=http://c3voc.mazdermind.de/avsync.mp4 \
- name=src \
- \
- src. !\
- queue !\
- videoconvert !\
- videoscale !\
- video/x-raw,height=600,width=800,format=I420,framerate=25/1 ! \
- timeoverlay valignment=bottom ! \
- gdppay ! \
- tcpclientsink host=localhost port=5000 \
- \
- src. !\
- queue !\
- audioconvert !\
- audioresample !\
- audiorate !\
- audio/x-raw,format=S16LE,layout=interleaved,rate=48000,channels=2 !\
- gdppay !\
- tcpclientsink host=localhost port=6000
diff --git a/voctocore/experiments/test-eevblog.sh b/voctocore/experiments/test-eevblog.sh
deleted file mode 100755
index fb7afc5..0000000
--- a/voctocore/experiments/test-eevblog.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-gst-launch-1.0 -vm \
- filesrc location=$HOME/eevblog.mp4 !\
- decodebin name=src \
- \
- src. !\
- queue !\
- videoconvert !\
- videoscale !\
- video/x-raw,height=600,width=800,format=I420,framerate=25/1 ! \
- timeoverlay valignment=bottom ! \
- gdppay ! \
- tcpclientsink host=localhost port=5000 \
- \
- src. !\
- queue !\
- audioconvert !\
- audioresample !\
- audiorate !\
- audio/x-raw,format=S16LE,layout=interleaved,rate=48000,channels=2 !\
- gdppay !\
- tcpclientsink host=localhost port=6000
diff --git a/voctocore/experiments/test-video.sh b/voctocore/experiments/test-video.sh
deleted file mode 100755
index 005b25a..0000000
--- a/voctocore/experiments/test-video.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-gst-launch-1.0 videotestsrc ! video/x-raw,height=600,width=800,format=I420,framerate=25/1 ! timeoverlay valignment=bottom ! gdppay ! tcpclientsink host=localhost port=5000