From 39c8cb3a0e3813ef77c61c601d0028281c04ad2d Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Sun, 6 Dec 2015 20:28:02 +0100 Subject: [example-scripts] overhaul and test all example scripts, fixes #5 --- example-scripts/README.md | 5 ++ example-scripts/audio-play-cam1-mirror.sh | 5 -- example-scripts/audio-play-cam2-mirror.sh | 5 -- example-scripts/audio-visualize-cam1-mirror.sh | 9 --- example-scripts/av-play-cam1-mirror.sh | 12 ---- example-scripts/av-play-output-ffplay.sh | 2 - example-scripts/av-record-cam1-mirror.sh | 20 ------- .../av-record-output-ffmpeg-timestamps.sh | 8 --- example-scripts/av-record-output-ffmpeg.sh | 8 --- example-scripts/av-record-output.sh | 20 ------- example-scripts/av-source-avsync-ffmpeg-noloop.sh | 9 --- example-scripts/av-source-avsync-ffmpeg.sh | 9 --- example-scripts/av-source-avsync.sh | 23 -------- example-scripts/av-source-background-loop.py | 63 --------------------- example-scripts/av-source-background-loop.sh | 7 --- example-scripts/av-source-background.sh | 6 -- example-scripts/av-source-bmd-cam1.sh | 8 --- example-scripts/av-source-bmd-cam2.sh | 8 --- example-scripts/av-source-cam1.sh | 10 ---- example-scripts/av-source-cam2.sh | 10 ---- example-scripts/av-source-eevblog-ffmpeg.sh | 9 --- example-scripts/av-source-eevblog.sh | 22 -------- example-scripts/av-source-grabber.sh | 11 ---- example-scripts/av-stream-hd.sh | 12 ---- example-scripts/av-stream-sd.sh | 10 ---- example-scripts/benchmark.sh | 13 ----- example-scripts/control-server/demo-cycle-modes.sh | 42 ++++++++++++++ example-scripts/control-server/set-audio-cam1.sh | 2 + example-scripts/control-server/set-audio-cam2.sh | 2 + .../control-server/set-composite-fullscreen.sh | 2 + .../set-composite-picture-in-picture.sh | 2 + .../set-composite-side-by-side-equal.sh | 2 + .../set-composite-side-by-side-preview.sh | 2 + .../control-server/set-stream-blank-nostream.sh | 2 + .../control-server/set-stream-blank-pause.sh | 2 + example-scripts/control-server/set-stream-live.sh | 2 + example-scripts/control-server/set-video-cam1.sh | 2 + example-scripts/control-server/set-video-cam2.sh | 2 + .../control-server/set-video-grabber.sh | 2 + example-scripts/demo-cube-files.sh | 15 ----- example-scripts/demo-cube.sh | 15 ----- example-scripts/demo-cycle-modes.sh | 42 -------------- example-scripts/demo-local.sh | 15 ----- example-scripts/ffmpeg/play-mixed-ffplay.sh | 2 + .../record-mixed-ffmpeg-segmented-timestamps.sh | 8 +++ .../ffmpeg/record-mixed-ffmpeg-segmented.sh | 8 +++ example-scripts/ffmpeg/record-mixed-ffmpeg.sh | 8 +++ .../ffmpeg/source-avsync-test-clip-as-cam1.sh | 9 +++ .../source-avsync-test-clip-looped-as-cam1.sh | 10 ++++ example-scripts/ffmpeg/source-background-loop.sh | 9 +++ example-scripts/ffmpeg/source-decklink-cam1.sh | 7 +++ example-scripts/ffmpeg/source-decklink-cam2.sh | 7 +++ example-scripts/ffmpeg/source-mjpg-framegrabber.sh | 14 +++++ example-scripts/ffmpeg/source-testvideo-as-cam1.sh | 10 ++++ example-scripts/ffmpeg/source-testvideo-as-cam2.sh | 10 ++++ example-scripts/ffmpeg/stream-hd.sh | 22 ++++++++ example-scripts/ffmpeg/stream-sd.sh | 22 ++++++++ example-scripts/gstreamer/play-cam1-av.sh | 13 +++++ example-scripts/gstreamer/play-mixed-audio.sh | 5 ++ example-scripts/gstreamer/play-mixed-av.sh | 13 +++++ example-scripts/gstreamer/play-mixed-video.sh | 6 ++ example-scripts/gstreamer/play-mixer-video.sh | 6 ++ example-scripts/gstreamer/record-mixed-av.sh | 21 +++++++ .../gstreamer/source-avsync-test-clip-as-cam1.sh | 23 ++++++++ .../gstreamer/source-background-loop.py | 66 ++++++++++++++++++++++ .../gstreamer/source-test-background.sh | 6 ++ example-scripts/gstreamer/visualize-mixed-audio.sh | 9 +++ example-scripts/misc/benchmark.sh | 13 +++++ example-scripts/misc/demo-local.sh | 15 +++++ example-scripts/misc/perf.sh | 12 ++++ example-scripts/perf.sh | 12 ---- example-scripts/set-audio-cam1.sh | 2 - example-scripts/set-audio-cam2.sh | 2 - example-scripts/set-composite-fullscreen.sh | 2 - .../set-composite-picture-in-picture.sh | 2 - .../set-composite-side-by-side-equal.sh | 2 - .../set-composite-side-by-side-preview.sh | 2 - example-scripts/set-stream-blank-nostream.sh | 2 - example-scripts/set-stream-blank-pause.sh | 2 - example-scripts/set-stream-live.sh | 2 - example-scripts/set-video-cam1.sh | 2 - example-scripts/set-video-cam2.sh | 2 - example-scripts/set-video-grabber.sh | 2 - example-scripts/video-play-cam1-mirror.sh | 5 -- example-scripts/video-play-cam2-mirror.sh | 5 -- example-scripts/video-play-mixer-output.sh | 5 -- 86 files changed, 425 insertions(+), 457 deletions(-) create mode 100644 example-scripts/README.md delete mode 100755 example-scripts/audio-play-cam1-mirror.sh delete mode 100755 example-scripts/audio-play-cam2-mirror.sh delete mode 100755 example-scripts/audio-visualize-cam1-mirror.sh delete mode 100755 example-scripts/av-play-cam1-mirror.sh delete mode 100755 example-scripts/av-play-output-ffplay.sh delete mode 100755 example-scripts/av-record-cam1-mirror.sh delete mode 100755 example-scripts/av-record-output-ffmpeg-timestamps.sh delete mode 100755 example-scripts/av-record-output-ffmpeg.sh delete mode 100755 example-scripts/av-record-output.sh delete mode 100755 example-scripts/av-source-avsync-ffmpeg-noloop.sh delete mode 100755 example-scripts/av-source-avsync-ffmpeg.sh delete mode 100755 example-scripts/av-source-avsync.sh delete mode 100755 example-scripts/av-source-background-loop.py delete mode 100755 example-scripts/av-source-background-loop.sh delete mode 100755 example-scripts/av-source-background.sh delete mode 100755 example-scripts/av-source-bmd-cam1.sh delete mode 100755 example-scripts/av-source-bmd-cam2.sh delete mode 100755 example-scripts/av-source-cam1.sh delete mode 100755 example-scripts/av-source-cam2.sh delete mode 100755 example-scripts/av-source-eevblog-ffmpeg.sh delete mode 100755 example-scripts/av-source-eevblog.sh delete mode 100755 example-scripts/av-source-grabber.sh delete mode 100755 example-scripts/av-stream-hd.sh delete mode 100755 example-scripts/av-stream-sd.sh delete mode 100755 example-scripts/benchmark.sh create mode 100755 example-scripts/control-server/demo-cycle-modes.sh create mode 100755 example-scripts/control-server/set-audio-cam1.sh create mode 100755 example-scripts/control-server/set-audio-cam2.sh create mode 100755 example-scripts/control-server/set-composite-fullscreen.sh create mode 100755 example-scripts/control-server/set-composite-picture-in-picture.sh create mode 100755 example-scripts/control-server/set-composite-side-by-side-equal.sh create mode 100755 example-scripts/control-server/set-composite-side-by-side-preview.sh create mode 100755 example-scripts/control-server/set-stream-blank-nostream.sh create mode 100755 example-scripts/control-server/set-stream-blank-pause.sh create mode 100755 example-scripts/control-server/set-stream-live.sh create mode 100755 example-scripts/control-server/set-video-cam1.sh create mode 100755 example-scripts/control-server/set-video-cam2.sh create mode 100755 example-scripts/control-server/set-video-grabber.sh delete mode 100755 example-scripts/demo-cube-files.sh delete mode 100755 example-scripts/demo-cube.sh delete mode 100755 example-scripts/demo-cycle-modes.sh delete mode 100755 example-scripts/demo-local.sh create mode 100755 example-scripts/ffmpeg/play-mixed-ffplay.sh create mode 100755 example-scripts/ffmpeg/record-mixed-ffmpeg-segmented-timestamps.sh create mode 100755 example-scripts/ffmpeg/record-mixed-ffmpeg-segmented.sh create mode 100755 example-scripts/ffmpeg/record-mixed-ffmpeg.sh create mode 100755 example-scripts/ffmpeg/source-avsync-test-clip-as-cam1.sh create mode 100755 example-scripts/ffmpeg/source-avsync-test-clip-looped-as-cam1.sh create mode 100755 example-scripts/ffmpeg/source-background-loop.sh create mode 100755 example-scripts/ffmpeg/source-decklink-cam1.sh create mode 100755 example-scripts/ffmpeg/source-decklink-cam2.sh create mode 100755 example-scripts/ffmpeg/source-mjpg-framegrabber.sh create mode 100755 example-scripts/ffmpeg/source-testvideo-as-cam1.sh create mode 100755 example-scripts/ffmpeg/source-testvideo-as-cam2.sh create mode 100755 example-scripts/ffmpeg/stream-hd.sh create mode 100755 example-scripts/ffmpeg/stream-sd.sh create mode 100755 example-scripts/gstreamer/play-cam1-av.sh create mode 100755 example-scripts/gstreamer/play-mixed-audio.sh create mode 100755 example-scripts/gstreamer/play-mixed-av.sh create mode 100755 example-scripts/gstreamer/play-mixed-video.sh create mode 100644 example-scripts/gstreamer/play-mixer-video.sh create mode 100755 example-scripts/gstreamer/record-mixed-av.sh create mode 100755 example-scripts/gstreamer/source-avsync-test-clip-as-cam1.sh create mode 100755 example-scripts/gstreamer/source-background-loop.py create mode 100755 example-scripts/gstreamer/source-test-background.sh create mode 100755 example-scripts/gstreamer/visualize-mixed-audio.sh create mode 100755 example-scripts/misc/benchmark.sh create mode 100755 example-scripts/misc/demo-local.sh create mode 100755 example-scripts/misc/perf.sh delete mode 100755 example-scripts/perf.sh delete mode 100755 example-scripts/set-audio-cam1.sh delete mode 100755 example-scripts/set-audio-cam2.sh delete mode 100755 example-scripts/set-composite-fullscreen.sh delete mode 100755 example-scripts/set-composite-picture-in-picture.sh delete mode 100755 example-scripts/set-composite-side-by-side-equal.sh delete mode 100755 example-scripts/set-composite-side-by-side-preview.sh delete mode 100755 example-scripts/set-stream-blank-nostream.sh delete mode 100755 example-scripts/set-stream-blank-pause.sh delete mode 100755 example-scripts/set-stream-live.sh delete mode 100755 example-scripts/set-video-cam1.sh delete mode 100755 example-scripts/set-video-cam2.sh delete mode 100755 example-scripts/set-video-grabber.sh delete mode 100755 example-scripts/video-play-cam1-mirror.sh delete mode 100755 example-scripts/video-play-cam2-mirror.sh delete mode 100755 example-scripts/video-play-mixer-output.sh diff --git a/example-scripts/README.md b/example-scripts/README.md new file mode 100644 index 0000000..d844fca --- /dev/null +++ b/example-scripts/README.md @@ -0,0 +1,5 @@ +# Voctomix Example-Scripts + +This folder is a collection of Scripts that show how different A/V Sources and sinks can interoperate with the voctocore. Some of them can be used in production as-is while some can serve as a template for whatever you need in your situation. + +They are grouped into main categories, depending on their purpose an the external tool they are using. The c3voc only uses the ffmpeg tools so they are the *preferred method* of getting data in and out of voctomix, because they are tested and used in production. diff --git a/example-scripts/audio-play-cam1-mirror.sh b/example-scripts/audio-play-cam1-mirror.sh deleted file mode 100755 index 6b60a9b..0000000 --- a/example-scripts/audio-play-cam1-mirror.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -gst-launch-1.0 \ - tcpclientsrc host=localhost port=13000 !\ - matroskademux !\ - alsasink diff --git a/example-scripts/audio-play-cam2-mirror.sh b/example-scripts/audio-play-cam2-mirror.sh deleted file mode 100755 index e9f2fb1..0000000 --- a/example-scripts/audio-play-cam2-mirror.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -gst-launch-1.0 \ - tcpclientsrc host=localhost port=13001 !\ - matroskademux !\ - alsasink diff --git a/example-scripts/audio-visualize-cam1-mirror.sh b/example-scripts/audio-visualize-cam1-mirror.sh deleted file mode 100755 index 70772c4..0000000 --- a/example-scripts/audio-visualize-cam1-mirror.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -gst-launch-1.0 \ - tcpclientsrc host=localhost port=13000 !\ - matroskademux !\ - audioconvert !\ - wavescope shader=none style=lines !\ - video/x-raw,width=800,height=300 !\ - videoconvert !\ - xvimagesink diff --git a/example-scripts/av-play-cam1-mirror.sh b/example-scripts/av-play-cam1-mirror.sh deleted file mode 100755 index 0ec1f2b..0000000 --- a/example-scripts/av-play-cam1-mirror.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -gst-launch-1.0 \ - tcpclientsrc host=localhost port=13000 !\ - matroskademux name=demux \ - \ - demux. !\ - queue !\ - xvimagesink ts-offset=300000000 \ - \ - demux. !\ - queue !\ - alsasink provide-clock=false ts-offset=300000000 diff --git a/example-scripts/av-play-output-ffplay.sh b/example-scripts/av-play-output-ffplay.sh deleted file mode 100755 index 733c279..0000000 --- a/example-scripts/av-play-output-ffplay.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -ffplay tcp://localhost:11000 diff --git a/example-scripts/av-record-cam1-mirror.sh b/example-scripts/av-record-cam1-mirror.sh deleted file mode 100755 index 5726535..0000000 --- a/example-scripts/av-record-cam1-mirror.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh -gst-launch-1.0 \ - tcpclientsrc host=localhost port=13000 !\ - matroskademux name=demux \ - \ - demux. !\ - queue !\ - avenc_mpeg2video bitrate=5000000 max-key-interval=0 !\ - queue !\ - mux. \ - \ - demux. !\ - queue !\ - audioconvert !\ - avenc_mp2 bitrate=192000 !\ - queue !\ - mux. \ - \ - mpegtsmux name=mux !\ - filesink location=foo.ts diff --git a/example-scripts/av-record-output-ffmpeg-timestamps.sh b/example-scripts/av-record-output-ffmpeg-timestamps.sh deleted file mode 100755 index 86bd1d1..0000000 --- a/example-scripts/av-record-output-ffmpeg-timestamps.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -ffmpeg \ - -i tcp://localhost:11000 \ - -ac 2 -channel_layout 2 -aspect 16:9 \ - -map 0:v -c:v:0 mpeg2video -pix_fmt:v:0 yuv422p -qscale:v:0 2 -qmin:v:0 2 -qmax:v:0 7 -keyint_min 0 -bf:0 0 -g:0 0 -intra:0 -maxrate:0 90M \ - -map 0:a -c:a:0 mp2 -b:a:0 192k -ac:a:0 2 -ar:a:0 48000 \ - -flags +global_header -flags +ilme+ildct \ - -f segment -segment_time 180 -segment_format mpegts segment-%t-%05d.ts.ts diff --git a/example-scripts/av-record-output-ffmpeg.sh b/example-scripts/av-record-output-ffmpeg.sh deleted file mode 100755 index 0ea3d25..0000000 --- a/example-scripts/av-record-output-ffmpeg.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -ffmpeg \ - -i tcp://localhost:11000 \ - -ac 2 -channel_layout 2 -aspect 16:9 \ - -map 0:v -c:v:0 mpeg2video -pix_fmt:v:0 yuv422p -qscale:v:0 2 -qmin:v:0 2 -qmax:v:0 7 -keyint_min 0 -bf:0 0 -g:0 0 -intra:0 -maxrate:0 90M \ - -map 0:a -c:a:0 mp2 -b:a:0 192k -ac:a:0 2 -ar:a:0 48000 \ - -flags +global_header -flags +ilme+ildct \ - -f segment -segment_time 180 -segment_format mpegts segment-%d.ts diff --git a/example-scripts/av-record-output.sh b/example-scripts/av-record-output.sh deleted file mode 100755 index ef306ed..0000000 --- a/example-scripts/av-record-output.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh -gst-launch-1.0 \ - tcpclientsrc host=localhost port=11000 !\ - matroskademux name=demux \ - \ - demux. !\ - queue !\ - avenc_mpeg2video bitrate=5000000 max-key-interval=0 !\ - queue !\ - mux. \ - \ - demux. !\ - queue !\ - audioconvert !\ - avenc_mp2 bitrate=192000 !\ - queue !\ - mux. \ - \ - mpegtsmux name=mux !\ - filesink location=foo.ts diff --git a/example-scripts/av-source-avsync-ffmpeg-noloop.sh b/example-scripts/av-source-avsync-ffmpeg-noloop.sh deleted file mode 100755 index 61aed59..0000000 --- a/example-scripts/av-source-avsync-ffmpeg-noloop.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -ffmpeg -y \ - -i $HOME/avsync.ts \ - -vf scale=1920x1080 \ - -c:v rawvideo \ - -c:a pcm_s16le \ - -pix_fmt uyvy422 \ - -f matroska \ - tcp://localhost:10000 diff --git a/example-scripts/av-source-avsync-ffmpeg.sh b/example-scripts/av-source-avsync-ffmpeg.sh deleted file mode 100755 index 3f9a06e..0000000 --- a/example-scripts/av-source-avsync-ffmpeg.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -(while true; do cat $HOME/avsync.ts || exit; done) | ffmpeg -y \ - -i - \ - -vf scale=1920x1080 \ - -c:v rawvideo \ - -c:a pcm_s16le \ - -pix_fmt uyvy422 \ - -f matroska \ - tcp://localhost:10000 diff --git a/example-scripts/av-source-avsync.sh b/example-scripts/av-source-avsync.sh deleted file mode 100755 index 1e8d1eb..0000000 --- a/example-scripts/av-source-avsync.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -gst-launch-1.0 \ - uridecodebin \ - uri=http://c3voc.mazdermind.de/avsync.mp4 \ - name=src \ - \ - src. !\ - queue !\ - videoconvert !\ - videoscale !\ - video/x-raw,format=UYVY,width=1280,height=720,framerate=25/1,pixel-aspect-ratio=1/1 ! \ - mux. \ - \ - src. !\ - queue !\ - audioconvert !\ - audioresample !\ - audiorate !\ - audio/x-raw,format=S16LE,channels=2,layout=interleaved,rate=48000 !\ - mux. \ - \ - matroskamux name=mux !\ - tcpclientsink host=localhost port=10001 diff --git a/example-scripts/av-source-background-loop.py b/example-scripts/av-source-background-loop.py deleted file mode 100755 index 9f4dc6d..0000000 --- a/example-scripts/av-source-background-loop.py +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/python3 -import sys, gi, signal - -gi.require_version('Gst', '1.0') -from gi.repository import Gst, GObject - -# init GObject & Co. before importing local classes -GObject.threads_init() -Gst.init([]) - -class LoopSource(object): - def __init__(self): - pipeline = """ - uridecodebin name=src uri=http://c3voc.mazdermind.de/bg.ts ! - video/x-raw,format=I420,width=1920,height=1080,framerate=25/1,pixel-aspect-ratio=1/1 ! - matroskamux ! - tcpclientsink host=localhost port=16000 - """ - - self.senderPipeline = Gst.parse_launch(pipeline) - self.src = self.senderPipeline.get_by_name('src') - - # Binding End-of-Stream-Signal on Source-Pipeline - self.senderPipeline.bus.add_signal_watch() - self.senderPipeline.bus.connect("message::eos", self.on_eos) - self.senderPipeline.bus.connect("message::error", self.on_error) - - print("playing") - self.senderPipeline.set_state(Gst.State.PLAYING) - - - def on_eos(self, bus, message): - print('Received EOS-Signal, Seeking to start') - self.src.seek( - 1.0, # rate (float) - Gst.Format.TIME, # format (Gst.Format) - Gst.SeekFlags.FLUSH, # flags (Gst.SeekFlags) - Gst.SeekType.SET, # start_type (Gst.SeekType) - 0, # start (int) - Gst.SeekType.NONE, # stop_type (Gst.SeekType) - 0 # stop (int) - ) - - def on_error(self, bus, message): - print('Received Error-Signal') - (error, debug) = message.parse_error() - print('Error-Details: #%u: %s' % (error.code, debug)) - sys.exit(1) - -def main(): - signal.signal(signal.SIGINT, signal.SIG_DFL) - - src = LoopSource() - - mainloop = GObject.MainLoop() - try: - mainloop.run() - except KeyboardInterrupt: - print('Terminated via Ctrl-C') - - -if __name__ == '__main__': - main() diff --git a/example-scripts/av-source-background-loop.sh b/example-scripts/av-source-background-loop.sh deleted file mode 100755 index 6a269f4..0000000 --- a/example-scripts/av-source-background-loop.sh +++ /dev/null @@ -1,7 +0,0 @@ -while true; do cat ~/bg.ts || exit 1; done |\ - ffmpeg -re -i - \ - -map 0:v \ - -c:v rawvideo \ - -pix_fmt uyvy422 \ - -f matroska \ - tcp://localhost:16000 diff --git a/example-scripts/av-source-background.sh b/example-scripts/av-source-background.sh deleted file mode 100755 index 94dc978..0000000 --- a/example-scripts/av-source-background.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -gst-launch-1.0 \ - videotestsrc pattern=ball !\ - video/x-raw,format=UYVY,width=1280,height=720,framerate=25/1,pixel-aspect-ratio=1/1 !\ - matroskamux !\ - tcpclientsink host=localhost port=16000 diff --git a/example-scripts/av-source-bmd-cam1.sh b/example-scripts/av-source-bmd-cam1.sh deleted file mode 100755 index 542b2f7..0000000 --- a/example-scripts/av-source-bmd-cam1.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -ffmpeg -y \ - -f decklink \ - -i 'DeckLink Mini Recorder (1)@10' \ - -c:v rawvideo -c:a pcm_s16le \ - -pix_fmt uyvy422 \ - -f matroska \ - tcp://localhost:10000 diff --git a/example-scripts/av-source-bmd-cam2.sh b/example-scripts/av-source-bmd-cam2.sh deleted file mode 100755 index ee5e0e4..0000000 --- a/example-scripts/av-source-bmd-cam2.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -ffmpeg -y \ - -f decklink \ - -i 'DeckLink Mini Recorder (2)@10' \ - -c:v rawvideo -c:a pcm_s16le \ - -pix_fmt uyvy422 \ - -f matroska \ - tcp://localhost:10001 diff --git a/example-scripts/av-source-cam1.sh b/example-scripts/av-source-cam1.sh deleted file mode 100755 index e61f336..0000000 --- a/example-scripts/av-source-cam1.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -ffmpeg -y \ - -i "$HOME/31c3-sendezentrum-1013-de-Methodisch_inkorrekt_Die_falsche_42_hd.mp4" \ - -ac 2 \ - -af aresample=48000 \ - -pix_fmt uyvy422 \ - -c:v rawvideo \ - -c:a pcm_s16le \ - -f matroska \ - tcp://localhost:10000 diff --git a/example-scripts/av-source-cam2.sh b/example-scripts/av-source-cam2.sh deleted file mode 100755 index d7da5a8..0000000 --- a/example-scripts/av-source-cam2.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -ffmpeg -y \ - -i "$HOME/31c3-sendezentrum-1003-de-Freak_Show_FS147_That_Escalatored_Quickly_hd.mp4" \ - -ac 2 \ - -af aresample=48000 \ - -pix_fmt uyvy422 \ - -c:v rawvideo \ - -c:a pcm_s16le \ - -f matroska \ - tcp://localhost:10001 diff --git a/example-scripts/av-source-eevblog-ffmpeg.sh b/example-scripts/av-source-eevblog-ffmpeg.sh deleted file mode 100755 index 20cbe1c..0000000 --- a/example-scripts/av-source-eevblog-ffmpeg.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -ffmpeg -y \ - -i $HOME/eevblog.mp4 \ - -c:v rawvideo \ - -c:a pcm_s16le \ - -pix_fmt uyvy422 \ - -af aresample=48000 \ - -f matroska \ - tcp://localhost:10000 diff --git a/example-scripts/av-source-eevblog.sh b/example-scripts/av-source-eevblog.sh deleted file mode 100755 index 8a7a10f..0000000 --- a/example-scripts/av-source-eevblog.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -gst-launch-1.0 \ - filesrc location=$HOME/eevblog.mp4 !\ - decodebin name=src \ - \ - src. !\ - queue !\ - videoconvert !\ - videoscale !\ - video/x-raw,format=UYVY,width=1280,height=720,framerate=25/1,pixel-aspect-ratio=1/1 ! \ - mux. \ - \ - src. !\ - queue !\ - audioconvert !\ - audioresample !\ - audiorate !\ - audio/x-raw,format=S16LE,channels=2,layout=interleaved,rate=48000 !\ - mux. \ - \ - matroskamux name=mux !\ - tcpclientsink host=localhost port=10000 diff --git a/example-scripts/av-source-grabber.sh b/example-scripts/av-source-grabber.sh deleted file mode 100755 index 038a870..0000000 --- a/example-scripts/av-source-grabber.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -ffmpeg -y \ - -i "http://10.73.5.2:1881/stream.mjpg" \ - -filter_complex " [0:v] scale=1920:1080,fps=25 [v] ; anullsrc=r=48000:cl=stereo [a] " \ - -map "[v]" \ - -map "[a]" \ - -c:a pcm_s16le \ - -c:v rawvideo \ - -pix_fmt uyvy422 \ - -f matroska \ - tcp://localhost:10002 diff --git a/example-scripts/av-stream-hd.sh b/example-scripts/av-stream-hd.sh deleted file mode 100755 index e273a02..0000000 --- a/example-scripts/av-stream-hd.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -ffmpeg -i tcp://localhost:11000 -aspect 16:9 -threads:0 0 \ --c:v libx264 \ --filter_complex " - yadif=mode=2, hqdn3d [deinter]; - movie=$HOME/overlay_hd.png [logo]; - [deinter] [logo] overlay=0:0 [out] -" -map '[out]' -maxrate:v:0 3000k -bufsize:v:0 8192k -crf:0 21 -pix_fmt:0 yuv420p -profile:v:0 main -g:v:0 25 -preset:v:0 veryfast \ --ac 1 -c:a libfdk_aac -b:a 96k -ar 44100 \ --map 0:a -filter:a:0 pan=mono:c0=FL \ --ac:a:2 2 \ --y -f flv rtmp://127.0.0.1:1935/stream/voctomix diff --git a/example-scripts/av-stream-sd.sh b/example-scripts/av-stream-sd.sh deleted file mode 100755 index 608c643..0000000 --- a/example-scripts/av-stream-sd.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -ffmpeg -i tcp://localhost:11000 -aspect 16:9 -threads:0 0 \ --c:v libx264 \ --filter_complex " - yadif=mode=2, hqdn3d, scale=720:576 [out] -" -map '[out]' -maxrate:v:0 800k -bufsize:v:0 8192k -crf:0 18 -pix_fmt:0 yuv420p -profile:v:0 main -g:v:0 25 -preset:v:0 veryfast \ --ac 1 -c:a libfdk_aac -b:a 96k -ar 44100 \ --map 0:a -filter:a:0 pan=mono:c0=FL \ --ac:a:2 2 \ --y -f flv rtmp://127.0.0.1:1935/stream/s5_native_sd diff --git a/example-scripts/benchmark.sh b/example-scripts/benchmark.sh deleted file mode 100755 index 7b3a72b..0000000 --- a/example-scripts/benchmark.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -../voctocore.py & -PID=$! -echo "PID=$PID" -sleep 1 -./set-composite-side-by-side-equal.sh >/dev/null 2>/dev/null -./av-source-eevblog.sh >/dev/null 2>/dev/null & -./av-source-avsync.sh >/dev/null 2>/dev/null & -pidstat -p $PID 1 & -sleep 10 -kill $PID -wait diff --git a/example-scripts/control-server/demo-cycle-modes.sh b/example-scripts/control-server/demo-cycle-modes.sh new file mode 100755 index 0000000..b626b28 --- /dev/null +++ b/example-scripts/control-server/demo-cycle-modes.sh @@ -0,0 +1,42 @@ +while true; do + sleep 10 + echo "composite-picture-in-picture" + ./set-composite-picture-in-picture.sh + sleep 10 + echo "audio/video cam2" + ./set-video-cam2.sh + ./set-audio-cam2.sh + sleep 10 + echo "composite-side-by-side-preview" + ./set-composite-side-by-side-preview.sh + sleep 10 + echo "audio/video cam1" + ./set-audio-cam1.sh + ./set-video-cam1.sh + sleep 10 + echo "composite-fullscreen" + ./set-composite-fullscreen.sh + sleep 10 + echo "audio/video cam2" + ./set-audio-cam2.sh + ./set-video-cam2.sh + sleep 10 + echo "audio/video cam1" + ./set-video-cam1.sh + ./set-audio-cam1.sh + sleep 10 + echo "composite-side-by-side-equal" + ./set-composite-side-by-side-equal.sh + sleep 10 + echo "audio/video cam2" + ./set-video-cam2.sh + ./set-audio-cam2.sh + sleep 10 + echo "composite-picture-in-picture" + ./set-composite-picture-in-picture.sh + sleep 10 + echo "audio/video cam1, composite-fullscreen" + ./set-video-cam1.sh + ./set-audio-cam1.sh + ./set-composite-fullscreen.sh +done diff --git a/example-scripts/control-server/set-audio-cam1.sh b/example-scripts/control-server/set-audio-cam1.sh new file mode 100755 index 0000000..19d3b8e --- /dev/null +++ b/example-scripts/control-server/set-audio-cam1.sh @@ -0,0 +1,2 @@ +#!/bin/sh +echo set_audio cam1 | nc -q0 localhost 9999 diff --git a/example-scripts/control-server/set-audio-cam2.sh b/example-scripts/control-server/set-audio-cam2.sh new file mode 100755 index 0000000..9177772 --- /dev/null +++ b/example-scripts/control-server/set-audio-cam2.sh @@ -0,0 +1,2 @@ +#!/bin/sh +echo set_audio cam2 | nc -q0 localhost 9999 diff --git a/example-scripts/control-server/set-composite-fullscreen.sh b/example-scripts/control-server/set-composite-fullscreen.sh new file mode 100755 index 0000000..850e591 --- /dev/null +++ b/example-scripts/control-server/set-composite-fullscreen.sh @@ -0,0 +1,2 @@ +#!/bin/sh +echo set_composite_mode fullscreen | nc -q0 localhost 9999 diff --git a/example-scripts/control-server/set-composite-picture-in-picture.sh b/example-scripts/control-server/set-composite-picture-in-picture.sh new file mode 100755 index 0000000..eae3bea --- /dev/null +++ b/example-scripts/control-server/set-composite-picture-in-picture.sh @@ -0,0 +1,2 @@ +#!/bin/sh +echo set_composite_mode picture_in_picture | nc -q0 localhost 9999 diff --git a/example-scripts/control-server/set-composite-side-by-side-equal.sh b/example-scripts/control-server/set-composite-side-by-side-equal.sh new file mode 100755 index 0000000..37e3357 --- /dev/null +++ b/example-scripts/control-server/set-composite-side-by-side-equal.sh @@ -0,0 +1,2 @@ +#!/bin/sh +echo set_composite_mode side_by_side_equal | nc -q0 localhost 9999 diff --git a/example-scripts/control-server/set-composite-side-by-side-preview.sh b/example-scripts/control-server/set-composite-side-by-side-preview.sh new file mode 100755 index 0000000..dd8a04b --- /dev/null +++ b/example-scripts/control-server/set-composite-side-by-side-preview.sh @@ -0,0 +1,2 @@ +#!/bin/sh +echo set_composite_mode side_by_side_preview | nc -q0 localhost 9999 diff --git a/example-scripts/control-server/set-stream-blank-nostream.sh b/example-scripts/control-server/set-stream-blank-nostream.sh new file mode 100755 index 0000000..abdab4b --- /dev/null +++ b/example-scripts/control-server/set-stream-blank-nostream.sh @@ -0,0 +1,2 @@ +#!/bin/sh +echo set_stream_blank nostream | nc -q0 localhost 9999 diff --git a/example-scripts/control-server/set-stream-blank-pause.sh b/example-scripts/control-server/set-stream-blank-pause.sh new file mode 100755 index 0000000..abf3580 --- /dev/null +++ b/example-scripts/control-server/set-stream-blank-pause.sh @@ -0,0 +1,2 @@ +#!/bin/sh +echo set_stream_blank pause | nc -q0 localhost 9999 diff --git a/example-scripts/control-server/set-stream-live.sh b/example-scripts/control-server/set-stream-live.sh new file mode 100755 index 0000000..e2584c8 --- /dev/null +++ b/example-scripts/control-server/set-stream-live.sh @@ -0,0 +1,2 @@ +#!/bin/sh +echo set_stream_live | nc -q0 localhost 9999 diff --git a/example-scripts/control-server/set-video-cam1.sh b/example-scripts/control-server/set-video-cam1.sh new file mode 100755 index 0000000..d02b385 --- /dev/null +++ b/example-scripts/control-server/set-video-cam1.sh @@ -0,0 +1,2 @@ +#!/bin/sh +echo set_video_a cam1 | nc -q0 localhost 9999 diff --git a/example-scripts/control-server/set-video-cam2.sh b/example-scripts/control-server/set-video-cam2.sh new file mode 100755 index 0000000..c953ade --- /dev/null +++ b/example-scripts/control-server/set-video-cam2.sh @@ -0,0 +1,2 @@ +#!/bin/sh +echo set_video_a cam2 | nc -q0 localhost 9999 diff --git a/example-scripts/control-server/set-video-grabber.sh b/example-scripts/control-server/set-video-grabber.sh new file mode 100755 index 0000000..ee39c3b --- /dev/null +++ b/example-scripts/control-server/set-video-grabber.sh @@ -0,0 +1,2 @@ +#!/bin/sh +echo set_video_a grabber | nc -q0 localhost 9999 diff --git a/example-scripts/demo-cube-files.sh b/example-scripts/demo-cube-files.sh deleted file mode 100755 index 978c91e..0000000 --- a/example-scripts/demo-cube-files.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -../voctocore.py -vv & -PID=$! -echo "PID=$PID" -sleep 1 -./av-source-cam1.sh & -./av-source-cam2.sh & -./av-source-background-loop.py & -./av-record-output-ffmpeg-timestamps.sh & -./av-stream-hd.sh & -./demo-cycle-modes.sh & -while true; do sleep 1; done -kill $PID -wait diff --git a/example-scripts/demo-cube.sh b/example-scripts/demo-cube.sh deleted file mode 100755 index 587f533..0000000 --- a/example-scripts/demo-cube.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -../voctocore.py -vv & -PID=$! -echo "PID=$PID" -sleep 1 -./av-source-bmd-cam1.sh & -./av-source-bmd-cam2.sh & -./av-source-background-loop.py & -./av-record-output-ffmpeg-timestamps.sh & -./av-stream-hd.sh & -./demo-cycle-modes.sh & -while true; do sleep 1; done -kill $PID -wait diff --git a/example-scripts/demo-cycle-modes.sh b/example-scripts/demo-cycle-modes.sh deleted file mode 100755 index b626b28..0000000 --- a/example-scripts/demo-cycle-modes.sh +++ /dev/null @@ -1,42 +0,0 @@ -while true; do - sleep 10 - echo "composite-picture-in-picture" - ./set-composite-picture-in-picture.sh - sleep 10 - echo "audio/video cam2" - ./set-video-cam2.sh - ./set-audio-cam2.sh - sleep 10 - echo "composite-side-by-side-preview" - ./set-composite-side-by-side-preview.sh - sleep 10 - echo "audio/video cam1" - ./set-audio-cam1.sh - ./set-video-cam1.sh - sleep 10 - echo "composite-fullscreen" - ./set-composite-fullscreen.sh - sleep 10 - echo "audio/video cam2" - ./set-audio-cam2.sh - ./set-video-cam2.sh - sleep 10 - echo "audio/video cam1" - ./set-video-cam1.sh - ./set-audio-cam1.sh - sleep 10 - echo "composite-side-by-side-equal" - ./set-composite-side-by-side-equal.sh - sleep 10 - echo "audio/video cam2" - ./set-video-cam2.sh - ./set-audio-cam2.sh - sleep 10 - echo "composite-picture-in-picture" - ./set-composite-picture-in-picture.sh - sleep 10 - echo "audio/video cam1, composite-fullscreen" - ./set-video-cam1.sh - ./set-audio-cam1.sh - ./set-composite-fullscreen.sh -done diff --git a/example-scripts/demo-local.sh b/example-scripts/demo-local.sh deleted file mode 100755 index 440c979..0000000 --- a/example-scripts/demo-local.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -../voctocore/voctocore.py -vv & -PID=$! -echo "PID=$PID" -sleep 1 -./av-source-cam1.sh & -./av-source-cam2.sh & -./av-source-background-loop.sh & -./av-record-output-ffmpeg.sh & -#./av-stream-hd.sh & -./demo-cycle-modes.sh & -ffplay tcp://localhost:11000 -kill $PID -wait diff --git a/example-scripts/ffmpeg/play-mixed-ffplay.sh b/example-scripts/ffmpeg/play-mixed-ffplay.sh new file mode 100755 index 0000000..733c279 --- /dev/null +++ b/example-scripts/ffmpeg/play-mixed-ffplay.sh @@ -0,0 +1,2 @@ +#!/bin/sh +ffplay tcp://localhost:11000 diff --git a/example-scripts/ffmpeg/record-mixed-ffmpeg-segmented-timestamps.sh b/example-scripts/ffmpeg/record-mixed-ffmpeg-segmented-timestamps.sh new file mode 100755 index 0000000..86bd1d1 --- /dev/null +++ b/example-scripts/ffmpeg/record-mixed-ffmpeg-segmented-timestamps.sh @@ -0,0 +1,8 @@ +#!/bin/sh +ffmpeg \ + -i tcp://localhost:11000 \ + -ac 2 -channel_layout 2 -aspect 16:9 \ + -map 0:v -c:v:0 mpeg2video -pix_fmt:v:0 yuv422p -qscale:v:0 2 -qmin:v:0 2 -qmax:v:0 7 -keyint_min 0 -bf:0 0 -g:0 0 -intra:0 -maxrate:0 90M \ + -map 0:a -c:a:0 mp2 -b:a:0 192k -ac:a:0 2 -ar:a:0 48000 \ + -flags +global_header -flags +ilme+ildct \ + -f segment -segment_time 180 -segment_format mpegts segment-%t-%05d.ts.ts diff --git a/example-scripts/ffmpeg/record-mixed-ffmpeg-segmented.sh b/example-scripts/ffmpeg/record-mixed-ffmpeg-segmented.sh new file mode 100755 index 0000000..0ea3d25 --- /dev/null +++ b/example-scripts/ffmpeg/record-mixed-ffmpeg-segmented.sh @@ -0,0 +1,8 @@ +#!/bin/sh +ffmpeg \ + -i tcp://localhost:11000 \ + -ac 2 -channel_layout 2 -aspect 16:9 \ + -map 0:v -c:v:0 mpeg2video -pix_fmt:v:0 yuv422p -qscale:v:0 2 -qmin:v:0 2 -qmax:v:0 7 -keyint_min 0 -bf:0 0 -g:0 0 -intra:0 -maxrate:0 90M \ + -map 0:a -c:a:0 mp2 -b:a:0 192k -ac:a:0 2 -ar:a:0 48000 \ + -flags +global_header -flags +ilme+ildct \ + -f segment -segment_time 180 -segment_format mpegts segment-%d.ts diff --git a/example-scripts/ffmpeg/record-mixed-ffmpeg.sh b/example-scripts/ffmpeg/record-mixed-ffmpeg.sh new file mode 100755 index 0000000..fb3a03a --- /dev/null +++ b/example-scripts/ffmpeg/record-mixed-ffmpeg.sh @@ -0,0 +1,8 @@ +#!/bin/sh +ffmpeg \ + -i tcp://localhost:11000 \ + -ac 2 -channel_layout 2 -aspect 16:9 \ + -map 0:v -c:v:0 mpeg2video -pix_fmt:v:0 yuv422p -qscale:v:0 2 -qmin:v:0 2 -qmax:v:0 7 -keyint_min 0 -bf:0 0 -g:0 0 -intra:0 -maxrate:0 90M \ + -map 0:a -c:a:0 mp2 -b:a:0 192k -ac:a:0 2 -ar:a:0 48000 \ + -flags +global_header -flags +ilme+ildct \ + -f mpegts output.ts diff --git a/example-scripts/ffmpeg/source-avsync-test-clip-as-cam1.sh b/example-scripts/ffmpeg/source-avsync-test-clip-as-cam1.sh new file mode 100755 index 0000000..6fceff1 --- /dev/null +++ b/example-scripts/ffmpeg/source-avsync-test-clip-as-cam1.sh @@ -0,0 +1,9 @@ +#!/bin/sh +ffmpeg -y \ + -i http://c3voc.mazdermind.de/testfiles/avsync.ts \ + -vf scale=1920x1080 \ + -c:v rawvideo \ + -c:a pcm_s16le \ + -pix_fmt uyvy422 \ + -f matroska \ + tcp://localhost:10000 diff --git a/example-scripts/ffmpeg/source-avsync-test-clip-looped-as-cam1.sh b/example-scripts/ffmpeg/source-avsync-test-clip-looped-as-cam1.sh new file mode 100755 index 0000000..327b398 --- /dev/null +++ b/example-scripts/ffmpeg/source-avsync-test-clip-looped-as-cam1.sh @@ -0,0 +1,10 @@ +#!/bin/sh +wget -nc -O /tmp/avsync.ts http://c3voc.mazdermind.de/testfiles/avsync.ts +(while true; do cat /tmp/avsync.ts || exit; done) | ffmpeg -y \ + -i - \ + -vf scale=1920x1080 \ + -c:v rawvideo \ + -c:a pcm_s16le \ + -pix_fmt uyvy422 \ + -f matroska \ + tcp://localhost:10000 diff --git a/example-scripts/ffmpeg/source-background-loop.sh b/example-scripts/ffmpeg/source-background-loop.sh new file mode 100755 index 0000000..e18617f --- /dev/null +++ b/example-scripts/ffmpeg/source-background-loop.sh @@ -0,0 +1,9 @@ +#!/bin/sh +wget -nc -O /tmp/bg.ts http://c3voc.mazdermind.de/testfiles/bg.ts +while true; do cat /tmp/bg.ts || exit 1; done |\ + ffmpeg -re -i - \ + -map 0:v \ + -c:v rawvideo \ + -pix_fmt uyvy422 \ + -f matroska \ + tcp://localhost:16000 diff --git a/example-scripts/ffmpeg/source-decklink-cam1.sh b/example-scripts/ffmpeg/source-decklink-cam1.sh new file mode 100755 index 0000000..f6e5f8e --- /dev/null +++ b/example-scripts/ffmpeg/source-decklink-cam1.sh @@ -0,0 +1,7 @@ +#!/bin/sh +ffmpeg -y \ + -f decklink \ + -i 'DeckLink Mini Recorder (1)@10' \ + -c:v rawvideo -c:a pcm_s16le \ + -f matroska \ + tcp://localhost:10000 diff --git a/example-scripts/ffmpeg/source-decklink-cam2.sh b/example-scripts/ffmpeg/source-decklink-cam2.sh new file mode 100755 index 0000000..86137b8 --- /dev/null +++ b/example-scripts/ffmpeg/source-decklink-cam2.sh @@ -0,0 +1,7 @@ +#!/bin/sh +ffmpeg -y \ + -f decklink \ + -i 'DeckLink Mini Recorder (2)@10' \ + -c:v rawvideo -c:a pcm_s16le \ + -f matroska \ + tcp://localhost:10001 diff --git a/example-scripts/ffmpeg/source-mjpg-framegrabber.sh b/example-scripts/ffmpeg/source-mjpg-framegrabber.sh new file mode 100755 index 0000000..502644c --- /dev/null +++ b/example-scripts/ffmpeg/source-mjpg-framegrabber.sh @@ -0,0 +1,14 @@ +#!/bin/sh +ffmpeg -y \ + -i "http://10.73.5.2:1881/stream.mjpg" \ + -filter_complex " + [0:v] scale=1920:1080,fps=25 [v] ; + anullsrc=r=48000:cl=stereo [a] + " \ + -map "[v]" \ + -map "[a]" \ + -c:a pcm_s16le \ + -c:v rawvideo \ + -pix_fmt uyvy422 \ + -f matroska \ + tcp://localhost:10002 diff --git a/example-scripts/ffmpeg/source-testvideo-as-cam1.sh b/example-scripts/ffmpeg/source-testvideo-as-cam1.sh new file mode 100755 index 0000000..7f88bb7 --- /dev/null +++ b/example-scripts/ffmpeg/source-testvideo-as-cam1.sh @@ -0,0 +1,10 @@ +#!/bin/sh +ffmpeg -y \ + -i "http://ftp.uni-erlangen.de/cdn.media.ccc.de/broadcast/sendezentrum/h264-hd/31c3-sendezentrum-1013-de-Methodisch_inkorrekt_Die_falsche_42_hd.mp4" \ + -ac 2 \ + -af aresample=48000 \ + -pix_fmt uyvy422 \ + -c:v rawvideo \ + -c:a pcm_s16le \ + -f matroska \ + tcp://localhost:10000 diff --git a/example-scripts/ffmpeg/source-testvideo-as-cam2.sh b/example-scripts/ffmpeg/source-testvideo-as-cam2.sh new file mode 100755 index 0000000..b9adc82 --- /dev/null +++ b/example-scripts/ffmpeg/source-testvideo-as-cam2.sh @@ -0,0 +1,10 @@ +#!/bin/sh +ffmpeg -y \ + -i "http://ftp.uni-erlangen.de/cdn.media.ccc.de/broadcast/sendezentrum/h264-hd/31c3-sendezentrum-1003-de-Freak_Show_FS147_That_Escalatored_Quickly_hd.mp4" \ + -ac 2 \ + -af aresample=48000 \ + -pix_fmt uyvy422 \ + -c:v rawvideo \ + -c:a pcm_s16le \ + -f matroska \ + tcp://localhost:10001 diff --git a/example-scripts/ffmpeg/stream-hd.sh b/example-scripts/ffmpeg/stream-hd.sh new file mode 100755 index 0000000..6e449f0 --- /dev/null +++ b/example-scripts/ffmpeg/stream-hd.sh @@ -0,0 +1,22 @@ +#!/bin/sh +wget -nc -O /tmp/overlay_hd.png http://c3voc.mazdermind.de/testfiles/overlay_hd.png +ffmpeg -y \ + -i tcp://localhost:11000 \ + -threads:0 0 \ + -aspect 16:9 \ + -c:v libx264 \ + -filter_complex ' + [0:v] yadif=mode=2, hqdn3d [deinter]; + movie=/tmp/overlay_hd.png [logo]; + [deinter] [logo] overlay=0:0 [out] + ' \ + -map '[out]' \ + -maxrate:v:0 3000k -bufsize:v:0 8192k -crf:0 21 \ + -pix_fmt:0 yuv420p -profile:v:0 main -g:v:0 25 \ + -preset:v:0 veryfast \ + \ + -ac 1 -c:a libfdk_aac -b:a 96k -ar 44100 \ + -map 0:a -filter:a:0 pan=mono:c0=FL \ + -ac:a:2 2 \ + \ + -y -f flv rtmp://127.0.0.1:1935/stream/voctomix_hd diff --git a/example-scripts/ffmpeg/stream-sd.sh b/example-scripts/ffmpeg/stream-sd.sh new file mode 100755 index 0000000..e5a0106 --- /dev/null +++ b/example-scripts/ffmpeg/stream-sd.sh @@ -0,0 +1,22 @@ +#!/bin/sh +wget -nc -O /tmp/overlay_hd.png http://c3voc.mazdermind.de/testfiles/overlay_hd.png +ffmpeg -y \ + -i tcp://localhost:11000 \ + -threads:0 0 \ + -aspect 16:9 \ + -c:v libx264 \ + -filter_complex ' + [0:v] yadif=mode=2, hqdn3d, scale=720:576 [deinter]; + movie=/tmp/overlay_hd.png [logo]; + [deinter] [logo] overlay=0:0 [out] + ' \ + -map '[out]' \ + -maxrate:v:0 800k -bufsize:v:0 8192k -crf:0 18 \ + -pix_fmt:0 yuv420p -profile:v:0 main -g:v:0 25 \ + -preset:v:0 veryfast \ + \ + -ac 1 -c:a libfdk_aac -b:a 96k -ar 44100 \ + -map 0:a -filter:a:0 pan=mono:c0=FL \ + -ac:a:2 2 \ + \ + -y -f flv rtmp://127.0.0.1:1935/stream/voctomix_hd diff --git a/example-scripts/gstreamer/play-cam1-av.sh b/example-scripts/gstreamer/play-cam1-av.sh new file mode 100755 index 0000000..ab237ec --- /dev/null +++ b/example-scripts/gstreamer/play-cam1-av.sh @@ -0,0 +1,13 @@ +#!/bin/sh +gst-launch-1.0 \ + tcpclientsrc host=localhost port=13000 !\ + matroskademux name=demux \ + \ + demux. !\ + queue !\ + glupload !\ + glimagesink ts-offset=500000000 \ + \ + demux. !\ + queue !\ + alsasink provide-clock=false ts-offset=500000000 diff --git a/example-scripts/gstreamer/play-mixed-audio.sh b/example-scripts/gstreamer/play-mixed-audio.sh new file mode 100755 index 0000000..a1dfa1f --- /dev/null +++ b/example-scripts/gstreamer/play-mixed-audio.sh @@ -0,0 +1,5 @@ +#!/bin/sh +gst-launch-1.0 \ + tcpclientsrc host=localhost port=11000 !\ + matroskademux !\ + alsasink ts-offset=500000000 diff --git a/example-scripts/gstreamer/play-mixed-av.sh b/example-scripts/gstreamer/play-mixed-av.sh new file mode 100755 index 0000000..7437f43 --- /dev/null +++ b/example-scripts/gstreamer/play-mixed-av.sh @@ -0,0 +1,13 @@ +#!/bin/sh +gst-launch-1.0 \ + tcpclientsrc host=localhost port=11000 !\ + matroskademux name=demux \ + \ + demux. !\ + queue !\ + glupload !\ + glimagesink ts-offset=500000000 \ + \ + demux. !\ + queue !\ + alsasink provide-clock=false ts-offset=500000000 diff --git a/example-scripts/gstreamer/play-mixed-video.sh b/example-scripts/gstreamer/play-mixed-video.sh new file mode 100755 index 0000000..49cc6f7 --- /dev/null +++ b/example-scripts/gstreamer/play-mixed-video.sh @@ -0,0 +1,6 @@ +#!/bin/sh +gst-launch-1.0 \ + tcpclientsrc host=localhost port=11000 !\ + matroskademux !\ + glupload !\ + glimagesink ts-offset=500000000 diff --git a/example-scripts/gstreamer/play-mixer-video.sh b/example-scripts/gstreamer/play-mixer-video.sh new file mode 100644 index 0000000..49cc6f7 --- /dev/null +++ b/example-scripts/gstreamer/play-mixer-video.sh @@ -0,0 +1,6 @@ +#!/bin/sh +gst-launch-1.0 \ + tcpclientsrc host=localhost port=11000 !\ + matroskademux !\ + glupload !\ + glimagesink ts-offset=500000000 diff --git a/example-scripts/gstreamer/record-mixed-av.sh b/example-scripts/gstreamer/record-mixed-av.sh new file mode 100755 index 0000000..b8818c6 --- /dev/null +++ b/example-scripts/gstreamer/record-mixed-av.sh @@ -0,0 +1,21 @@ +#!/bin/sh +gst-launch-1.0 \ + tcpclientsrc host=localhost port=11000 !\ + matroskademux name=demux \ + \ + demux. !\ + queue !\ + videoconvert !\ + avenc_mpeg2video bitrate=5000000 max-key-interval=0 !\ + queue !\ + mux. \ + \ + demux. !\ + queue !\ + audioconvert !\ + avenc_mp2 bitrate=192000 !\ + queue !\ + mux. \ + \ + mpegtsmux name=mux !\ + filesink location=foo.ts diff --git a/example-scripts/gstreamer/source-avsync-test-clip-as-cam1.sh b/example-scripts/gstreamer/source-avsync-test-clip-as-cam1.sh new file mode 100755 index 0000000..ca7fc27 --- /dev/null +++ b/example-scripts/gstreamer/source-avsync-test-clip-as-cam1.sh @@ -0,0 +1,23 @@ +#!/bin/sh +gst-launch-1.0 \ + uridecodebin \ + uri=http://c3voc.mazdermind.de/testfiles/avsync.mp4 \ + name=src \ + \ + src. !\ + queue !\ + videoconvert !\ + videoscale !\ + video/x-raw,format=UYVY,width=1920,height=1080,framerate=25/1,pixel-aspect-ratio=1/1 ! \ + mux. \ + \ + src. !\ + queue !\ + audioconvert !\ + audioresample !\ + audiorate !\ + audio/x-raw,format=S16LE,channels=2,layout=interleaved,rate=48000 !\ + mux. \ + \ + matroskamux name=mux !\ + tcpclientsink host=localhost port=10000 diff --git a/example-scripts/gstreamer/source-background-loop.py b/example-scripts/gstreamer/source-background-loop.py new file mode 100755 index 0000000..be59d18 --- /dev/null +++ b/example-scripts/gstreamer/source-background-loop.py @@ -0,0 +1,66 @@ +#!/usr/bin/python3 +import sys, gi, signal + +gi.require_version('Gst', '1.0') +from gi.repository import Gst, GObject + +# init GObject & Co. before importing local classes +GObject.threads_init() +Gst.init([]) + +class LoopSource(object): + def __init__(self): + # it works much better with a local file + pipeline = """ + uridecodebin name=src uri=http://c3voc.mazdermind.de/testfiles/bg.ts ! + videoscale ! + videoconvert ! + video/x-raw,format=UYVY,width=1920,height=1080,framerate=25/1,pixel-aspect-ratio=1/1 ! + matroskamux ! + tcpclientsink host=localhost port=16000 + """ + + self.senderPipeline = Gst.parse_launch(pipeline) + self.src = self.senderPipeline.get_by_name('src') + + # Binding End-of-Stream-Signal on Source-Pipeline + self.senderPipeline.bus.add_signal_watch() + self.senderPipeline.bus.connect("message::eos", self.on_eos) + self.senderPipeline.bus.connect("message::error", self.on_error) + + print("playing") + self.senderPipeline.set_state(Gst.State.PLAYING) + + + def on_eos(self, bus, message): + print('Received EOS-Signal, Seeking to start') + self.src.seek( + 1.0, # rate (float) + Gst.Format.TIME, # format (Gst.Format) + Gst.SeekFlags.FLUSH, # flags (Gst.SeekFlags) + Gst.SeekType.SET, # start_type (Gst.SeekType) + 0, # start (int) + Gst.SeekType.NONE, # stop_type (Gst.SeekType) + 0 # stop (int) + ) + + def on_error(self, bus, message): + print('Received Error-Signal') + (error, debug) = message.parse_error() + print('Error-Details: #%u: %s' % (error.code, debug)) + sys.exit(1) + +def main(): + signal.signal(signal.SIGINT, signal.SIG_DFL) + + src = LoopSource() + + mainloop = GObject.MainLoop() + try: + mainloop.run() + except KeyboardInterrupt: + print('Terminated via Ctrl-C') + + +if __name__ == '__main__': + main() diff --git a/example-scripts/gstreamer/source-test-background.sh b/example-scripts/gstreamer/source-test-background.sh new file mode 100755 index 0000000..94dc978 --- /dev/null +++ b/example-scripts/gstreamer/source-test-background.sh @@ -0,0 +1,6 @@ +#!/bin/sh +gst-launch-1.0 \ + videotestsrc pattern=ball !\ + video/x-raw,format=UYVY,width=1280,height=720,framerate=25/1,pixel-aspect-ratio=1/1 !\ + matroskamux !\ + tcpclientsink host=localhost port=16000 diff --git a/example-scripts/gstreamer/visualize-mixed-audio.sh b/example-scripts/gstreamer/visualize-mixed-audio.sh new file mode 100755 index 0000000..ce9bc0a --- /dev/null +++ b/example-scripts/gstreamer/visualize-mixed-audio.sh @@ -0,0 +1,9 @@ +#!/bin/sh +gst-launch-1.0 \ + tcpclientsrc host=localhost port=13000 !\ + matroskademux !\ + audioconvert !\ + wavescope shader=none style=lines !\ + video/x-raw,width=800,height=300 !\ + glupload !\ + glimagesink diff --git a/example-scripts/misc/benchmark.sh b/example-scripts/misc/benchmark.sh new file mode 100755 index 0000000..70b8cfa --- /dev/null +++ b/example-scripts/misc/benchmark.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +../../voctocore/voctocore.py & +PID=$! +echo "PID=$PID" +sleep 1 +../control-server/set-composite-side-by-side-equal.sh >/dev/null 2>/dev/null +../ffmpeg/source-testvideo-as-cam1.sh >/dev/null 2>/dev/null & +../ffmpeg/source-testvideo-as-cam2.sh >/dev/null 2>/dev/null & +pidstat -p $PID 1 & +sleep 10 +kill $PID +wait diff --git a/example-scripts/misc/demo-local.sh b/example-scripts/misc/demo-local.sh new file mode 100755 index 0000000..bb57e45 --- /dev/null +++ b/example-scripts/misc/demo-local.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +../../voctocore/voctocore.py & +PID=$! +echo "PID=$PID" +sleep 1 +../ffmpeg/source-testvideo-as-cam1.sh >/dev/null 2>/dev/null & +../ffmpeg/source-testvideo-as-cam2.sh >/dev/null 2>/dev/null & +../ffmpeg/source-background-loop.sh & +../ffmpeg/av-record-output-ffmpeg.sh & +#../ffmpeg/stream-hd.sh & +../control-server/demo-cycle-modes.sh & +ffplay tcp://localhost:11000 +kill $PID +wait diff --git a/example-scripts/misc/perf.sh b/example-scripts/misc/perf.sh new file mode 100755 index 0000000..e347151 --- /dev/null +++ b/example-scripts/misc/perf.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +../../voctocore/voctocore.py & +PID=$! +echo "PID=$PID" +sleep 1 +../control-server/set-composite-side-by-side-equal.sh >/dev/null 2>/dev/null +../ffmpeg/source-testvideo-as-cam1.sh >/dev/null 2>/dev/null & +../ffmpeg/source-testvideo-as-cam2.sh >/dev/null 2>/dev/null & +sudo perf top -g -p $PID +kill $PID +wait diff --git a/example-scripts/perf.sh b/example-scripts/perf.sh deleted file mode 100755 index 035ec05..0000000 --- a/example-scripts/perf.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -../voctocore.py & -PID=$! -echo "PID=$PID" -sleep 1 -./set-composite-side-by-side-equal.sh >/dev/null 2>/dev/null -./av-source-eevblog.sh >/dev/null 2>/dev/null & -./av-source-avsync.sh >/dev/null 2>/dev/null & -sudo perf top -g -p $PID -kill $PID -wait diff --git a/example-scripts/set-audio-cam1.sh b/example-scripts/set-audio-cam1.sh deleted file mode 100755 index 19d3b8e..0000000 --- a/example-scripts/set-audio-cam1.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -echo set_audio cam1 | nc -q0 localhost 9999 diff --git a/example-scripts/set-audio-cam2.sh b/example-scripts/set-audio-cam2.sh deleted file mode 100755 index 9177772..0000000 --- a/example-scripts/set-audio-cam2.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -echo set_audio cam2 | nc -q0 localhost 9999 diff --git a/example-scripts/set-composite-fullscreen.sh b/example-scripts/set-composite-fullscreen.sh deleted file mode 100755 index 850e591..0000000 --- a/example-scripts/set-composite-fullscreen.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -echo set_composite_mode fullscreen | nc -q0 localhost 9999 diff --git a/example-scripts/set-composite-picture-in-picture.sh b/example-scripts/set-composite-picture-in-picture.sh deleted file mode 100755 index eae3bea..0000000 --- a/example-scripts/set-composite-picture-in-picture.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -echo set_composite_mode picture_in_picture | nc -q0 localhost 9999 diff --git a/example-scripts/set-composite-side-by-side-equal.sh b/example-scripts/set-composite-side-by-side-equal.sh deleted file mode 100755 index 37e3357..0000000 --- a/example-scripts/set-composite-side-by-side-equal.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -echo set_composite_mode side_by_side_equal | nc -q0 localhost 9999 diff --git a/example-scripts/set-composite-side-by-side-preview.sh b/example-scripts/set-composite-side-by-side-preview.sh deleted file mode 100755 index dd8a04b..0000000 --- a/example-scripts/set-composite-side-by-side-preview.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -echo set_composite_mode side_by_side_preview | nc -q0 localhost 9999 diff --git a/example-scripts/set-stream-blank-nostream.sh b/example-scripts/set-stream-blank-nostream.sh deleted file mode 100755 index abdab4b..0000000 --- a/example-scripts/set-stream-blank-nostream.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -echo set_stream_blank nostream | nc -q0 localhost 9999 diff --git a/example-scripts/set-stream-blank-pause.sh b/example-scripts/set-stream-blank-pause.sh deleted file mode 100755 index abf3580..0000000 --- a/example-scripts/set-stream-blank-pause.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -echo set_stream_blank pause | nc -q0 localhost 9999 diff --git a/example-scripts/set-stream-live.sh b/example-scripts/set-stream-live.sh deleted file mode 100755 index e2584c8..0000000 --- a/example-scripts/set-stream-live.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -echo set_stream_live | nc -q0 localhost 9999 diff --git a/example-scripts/set-video-cam1.sh b/example-scripts/set-video-cam1.sh deleted file mode 100755 index d02b385..0000000 --- a/example-scripts/set-video-cam1.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -echo set_video_a cam1 | nc -q0 localhost 9999 diff --git a/example-scripts/set-video-cam2.sh b/example-scripts/set-video-cam2.sh deleted file mode 100755 index c953ade..0000000 --- a/example-scripts/set-video-cam2.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -echo set_video_a cam2 | nc -q0 localhost 9999 diff --git a/example-scripts/set-video-grabber.sh b/example-scripts/set-video-grabber.sh deleted file mode 100755 index ee39c3b..0000000 --- a/example-scripts/set-video-grabber.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -echo set_video_a grabber | nc -q0 localhost 9999 diff --git a/example-scripts/video-play-cam1-mirror.sh b/example-scripts/video-play-cam1-mirror.sh deleted file mode 100755 index ec3605b..0000000 --- a/example-scripts/video-play-cam1-mirror.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -gst-launch-1.0 \ - tcpclientsrc host=localhost port=13000 !\ - matroskademux !\ - xvimagesink diff --git a/example-scripts/video-play-cam2-mirror.sh b/example-scripts/video-play-cam2-mirror.sh deleted file mode 100755 index e42ca6a..0000000 --- a/example-scripts/video-play-cam2-mirror.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -gst-launch-1.0 \ - tcpclientsrc host=localhost port=13001 !\ - matroskademux !\ - xvimagesink diff --git a/example-scripts/video-play-mixer-output.sh b/example-scripts/video-play-mixer-output.sh deleted file mode 100755 index abb3174..0000000 --- a/example-scripts/video-play-mixer-output.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -gst-launch-1.0 \ - tcpclientsrc host=localhost port=11000 !\ - matroskademux !\ - xvimagesink -- cgit v1.2.3