diff --git a/.gitignore b/.gitignore index 29b7a48..1e29f51 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -Snowmix-0.4.2 +Snowmix-* images/logo.* python/virtenv videos diff --git a/frames/test_1024x768 b/frames/test_1024x768 deleted file mode 100644 index 18a66d9..0000000 Binary files a/frames/test_1024x768 and /dev/null differ diff --git a/ini/base.ini b/ini/base.ini index 4ed42a2..50f9bc4 100644 --- a/ini/base.ini +++ b/ini/base.ini @@ -1,5 +1,4 @@ -# Basic Feeds Settings -# Copyright by Peter Maersk-Moller 2012 - All rights reserved +# Basic Feeds Settings for HTT 2015 verbose @@ -66,7 +65,7 @@ vfeed place rect 3 0 0 1280 720 0 0 #################### -# Small size vfeeds +# Small size vfeeds #################### vfeed add 4 SmallCam1 @@ -74,11 +73,11 @@ vfeed source feed 4 1 vfeed place rect 4 5 2 1280 720 0 0 0 0.492 0.492 1.0 vfeed add 5 SmallCam1 -vfeed source feed 5 2 +vfeed source feed 5 2 vfeed place rect 5 645 2 1280 720 0 0 0 0.492 0.492 1.0 vfeed add 6 SmallCam1 -vfeed source feed 6 3 +vfeed source feed 6 3 vfeed place rect 6 645 363 1280 720 0 0 0 0.492 0.492 1.0 @@ -92,12 +91,12 @@ image place 0 0 0 0 image load 1 images/logo.png image place 1 1 24 24 -text font 1 Source Code Pro Bold 40 +text font 1 Source Code Pro Bold 40 text string 1 00:00:00 text place 1 1 1 200 630 1.0 1.0 1.0 command create ShowAll - overlay image 0 + overlay image 0 vfeed overlay 4..6 text overlay 1 diff --git a/ini/test720p.ini b/ini/test720p.ini deleted file mode 100644 index 9f43188..0000000 --- a/ini/test720p.ini +++ /dev/null @@ -1,40 +0,0 @@ -# Basic Feeds Settings -# Copyright by Peter Maersk-Moller 2012 - All rights reserved - -verbose - -require version 0.4.5 - -# Define allowed remote host IP addresses. If omitted then only 127.0.0.1 will be accepted. -system host allow 127.0.0.1 - -# Listen on port 9999 for command control connections -system control port 9999 - -# Set system Geometry to 1024x768 -system geometry 1280 720 ARGB - -# Set system frame rate to 24 -system frame rate 25 - -# Set output control socket -system socket /tmp/mixer1 - -# Set feed idle time - feed 0 will always be idle. If no file is given, -# idle image will be all black. -feed idle 0 1 frames/test_1280x720 -#feed idle 0 1 - -################## -# Input feeds -################## - -feed add 1 Cam1 -feed geometry 1 1280 720 -feed live 1 -feed idle 1 100 frames/test_1280x720 -feed socket 1 /tmp/feed1 - -stack 0 1 - -monitor on diff --git a/python/camerfeed.py b/python/camerfeed.py deleted file mode 100644 index 8de8a32..0000000 --- a/python/camerfeed.py +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/env python2 -import pygst -pygst.require('0.10') -import gst - -MIXER_IP = 'localhost' -MIXER_PORT = 9999 - -class CameraFeed(object): - - def __init__(self, pipe, cam_ip): - self.pipe = pipe - self.cam_ip = cam_ip - - def _run(self): - snowmix_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - snowmix_socket.connect((ip, 9999)) - - diff --git a/python/clockcontroller.py b/python/controller/clockcontroller.py similarity index 100% rename from python/clockcontroller.py rename to python/controller/clockcontroller.py diff --git a/python/scenechanger.py b/python/controller/scenechanger.py similarity index 100% rename from python/scenechanger.py rename to python/controller/scenechanger.py diff --git a/python/videocontroller.py b/python/controller/videocontroller.py similarity index 100% rename from python/videocontroller.py rename to python/controller/videocontroller.py diff --git a/python/videocontroller.ui b/python/controller/videocontroller.ui similarity index 100% rename from python/videocontroller.ui rename to python/controller/videocontroller.ui diff --git a/python/camerafeed.py b/python/feeder/camerafeed.py similarity index 100% rename from python/camerafeed.py rename to python/feeder/camerafeed.py diff --git a/python/config.py b/python/feeder/config.py similarity index 94% rename from python/config.py rename to python/feeder/config.py index b364ea4..0412803 100644 --- a/python/config.py +++ b/python/feeder/config.py @@ -1,8 +1,8 @@ #!/bin/env python2 CAMERA_FEEDS = { - '/tmp/feed1' : '192.168.1.100', - '/tmp/feed2' : '192.168.1.101', + '/tmp/feed1' : '192.168.1.100', + '/tmp/feed2' : '192.168.1.101', '/tmp/feed3' : '192.168.1.102', } @@ -31,6 +31,3 @@ OUTPUT_SOURCE = 'shmsrc socket-path=%(mixer_pipe)s do-timestamp=true is-live=tru SCREEN_OUTPUT = 'videoscale ! video/x-raw-rgb, width=%(screen_width)d, height=%(screen_height)d !'\ + ' timeoverlay ! ximagesink' NETWORK_OUTPUT = 'ffmpegcolorspace ! timeoverlay ! x264enc tune="zerolatency" ! mpegtsmux ! tcpserversink host=0.0.0.0 port=%(port)d' - - - diff --git a/python/feed.py b/python/feeder/feed.py similarity index 100% rename from python/feed.py rename to python/feeder/feed.py diff --git a/python/outputfeed.py b/python/feeder/outputfeed.py similarity index 100% rename from python/outputfeed.py rename to python/feeder/outputfeed.py diff --git a/python/runfeeds.py b/python/feeder/runfeeds.py similarity index 100% rename from python/runfeeds.py rename to python/feeder/runfeeds.py diff --git a/scripts/cam1.sh b/scripts/cam1.sh deleted file mode 100755 index cbc4364..0000000 --- a/scripts/cam1.sh +++ /dev/null @@ -1,2 +0,0 @@ - #!/bin/bash - ./cam2feed.sh /tmp/feed1 "http://gstreamer:GlytEnru@192.168.50.100/videostream.cgi?rate=0" \ No newline at end of file diff --git a/scripts/cam2.sh b/scripts/cam2.sh deleted file mode 100755 index 30a4c8b..0000000 --- a/scripts/cam2.sh +++ /dev/null @@ -1,2 +0,0 @@ - #!/bin/bash - ./cam2feed.sh /tmp/feed2 "http://gstreamer:GlytEnru@192.168.50.101/videostream.cgi?rate=0" diff --git a/scripts/cam2feed.sh b/scripts/cam2feed.sh deleted file mode 100755 index 8831189..0000000 --- a/scripts/cam2feed.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -# Deliver a webcam video as input feed - -if [ -z "$1" -o -z "$2" ]; then - echo "Usage $0 " - exit -fi - -CONTROL_PIPE="$1" -MIXERFORMAT='video/x-raw-rgb, bpp=(int)32, depth=32, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)1024, height=(int)768, framerate=(fraction)24/1, pixel-aspect-ratio=(fraction)1/1, interlaced=(boolean)false' -SRC="souphttpsrc location=$2 ! jpegdec ! videorate" -SHMSIZE='shm-size=10000000' -SHMOPTION="wait-for-connection=0" -SHMSINK1="shmsink socket-path=$CONTROL_PIPE $SHMSIZE $SHMOPTION" -SCALE='ffmpegcolorspace ! videoscale ! ffmpegcolorspace' - - -while true ; do - # Remove the named pipe if it exist - rm -f $CONTROL_PIPE - gst-launch-0.10 -v \ - $SRC ! \ - $SCALE ! \ - $MIXERFORMAT ! \ - $SHMSINK1 - sleep 2 -done -exit diff --git a/scripts/cam3.sh b/scripts/cam3.sh deleted file mode 100755 index 4ee2fd9..0000000 --- a/scripts/cam3.sh +++ /dev/null @@ -1,2 +0,0 @@ - #!/bin/bash - ./cam2feed.sh /tmp/feed3 "http://gstreamer:GlytEnru@192.168.50.102/videostream.cgi?rate=0" diff --git a/scripts/camtest.sh b/scripts/camtest.sh deleted file mode 100755 index 5793bee..0000000 --- a/scripts/camtest.sh +++ /dev/null @@ -1,4 +0,0 @@ -MIXERCAPS='video/x-raw-rgb, width=(int)1024, height=(int)768' - - -gst-launch-0.10 -v souphttpsrc location=http://gstreamer:GlytEnru@$1/videostream.cgi?rate=0 ! jpegdec ! ffmpegcolorspace ! videoscale ! ffmpegcolorspace ! $MIXERCAPS ! ximagesink diff --git a/scripts/network2screen b/scripts/network2screen deleted file mode 100755 index b3b723e..0000000 --- a/scripts/network2screen +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -gst-launch-0.10 -v udpsrc port=9998 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)JPEG, payload=(int)96" ! rtpjpegdepay ! jpegdec ! videoscale ! xvimagesink diff --git a/scripts/output2screen b/scripts/output2screen deleted file mode 100755 index 39f494f..0000000 --- a/scripts/output2screen +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash -# Deliver mixer1 output to screen. -# Taken from the original snowmix sources -# USE OPEN-BSD NETCAT OTHERWISE THINGS KEEP BLOCKING - -if [ -z "$1" -o -z "$2" -o -z "$3" ]; then - echo "Usage $0 " - exit -fi - -remote_ip="$1" -outwidth="$2" -outheight="$3" - -tmpfile=/tmp/output2screen.tmp.$$ -echo 'system info' | nc 127.0.0.1 9999 >$tmpfile -geometry=`grep 'STAT: System geometry' $tmpfile |cut -f3 -d: |cut -f2 -d' '|tr 'x' ' '` -framerate=`grep 'STAT: Frame rate' $tmpfile |cut -f3 -d: |cut -f2 -d' '` -ctrsocket=`grep 'STAT: Output ctr socket' $tmpfile |cut -f3 -d: |cut -f2 -d' '` - -rm $tmpfile - -VIDEO=video/x-raw-rgb -AUDIO=audio/x-raw-int - - -frameratefraction() -{ - echo $1 | awk '{ rate=$1 ; - factor=1; - intrate=int(rate); - while (factor*rate > intrate) { - factor = factor * 10; - intrate = int(rate*factor); - } - printf("%d/%d\n",intrate,factor); - }' -} -ratefraction=`frameratefraction $framerate` - -width=`echo $geometry |cut -f1 -d' '` -height=`echo $geometry |cut -f2 -d' '` - -MIXERFORMAT=$VIDEO', bpp=(int)32, depth=(int)32, endianness=(int)4321, format=(fourcc)BGRA, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)'$width', height=(int)'$height', framerate=(fraction)'$ratefraction', pixel-aspect-ratio=(fraction)1/1, interlaced=(boolean)false' -OUTPUTFORMAT=$VIDEO', width='$outwidth', height='$outheight - - -while true ; do - gst-launch-0.10 -v shmsrc socket-path=$ctrsocket do-timestamp=true is-live=true ! \ - $MIXERFORMAT ! \ - queue leaky=2 !\ - tee name=atee ! \ - videoscale ! \ - $OUTPUTFORMAT ! \ - ffmpegcolorspace ! \ - queue ! \ - ximagesink \ - atee. !\ - queue leaky=2 !\ - timeoverlay !\ - ffmpegcolorspace !\ - 'video/x-raw-yuv' !\ - jpegenc !\ - rtpjpegpay !\ - udpsink host=$remote_ip port=9998 sync=true - sleep 2 -done diff --git a/scripts/outputtest b/scripts/outputtest deleted file mode 100644 index 36446b3..0000000 --- a/scripts/outputtest +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -FORMAT="video/x-raw-rgb, bpp=(int)32, endianness=(int)4321, format=(fourcc)BGRA, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)1280, height=(int)720, framerate=(fraction)25/1, pixel-aspect-ratio=(fraction)1/1, interlaced=(boolean)false" - -SCREEN_FORMAT="video/x-raw-rgb, width=(int)640, height=(int)360" - -gst-launch-0.10 -v shmsrc socket-path=/tmp/mixer1 do-timestamp=true is-live=true ! $FORMAT ! queue leaky=2 ! tee name=split ! queue ! videoscale ! $SCREEN_FORMAT ! timeoverlay ! ximagesink split. ! queue ! ffmpegcolorspace ! x264enc tune="zerolatency" ! mpegtsmux ! tcpserversink port=8042 - -#gst-launch-0.10 tcpclientsrc port=8042 host=localhost ! tsdemux ! h264parse ! ffdec_h264 ! xvimagesink diff --git a/scripts/test720p.py b/scripts/test720p.py deleted file mode 100644 index 7e04625..0000000 --- a/scripts/test720p.py +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/env python2 -import pygst -pygst.require('0.10') -import gst - -pipeline = gst.Pipeline('pipeline') - -file_src = gst.element_factory_make('filesrc', 'source'); -file_src.set_property('location', '../videos/tears_of_steel_720p.mkv') - -matroskademux = gst.element_factory_make('matroskademux') -h264parse = gst.element_factory_make('h264parse') -ffdec_h264 = gst.element_factory_make('ffdec_h264') - -colorspace1 = gst.element_factory_make('ffmpegcolorspace') -videoscale = gst.element_factory_make('videoscale') -colorspace2 = gst.element_factory_make('ffmpegcolorspace') - -caps = gst.Caps('video/x-raw-rgb, bpp=(int)32, endianness=(int)4321, format=(fourcc)BGRA, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)1280, height=(int)720, framerate=(fraction)24/1, pixel-aspect-ratio=(fraction)1/1, interlaced=(boolean)false') -caps_filter = gst.element_factory_make('capsfilter') -caps_filter.set_property('caps', caps); - -ximagesink = gst.element_factory_make('ximagesink') - -pipeline.add(file_src, matroskademux, h264parse, ffdec_h264, colorspace1, videoscale, colorspace2, caps_filter, ximagesink) -gst.element_link_many(file_src, matroskademux) -gst.element_link_many(h264parse, ffdec_h264, colorspace1, videoscale, colorspace2, caps_filter, ximagesink) - -def on_new_demux_pad(element): - matroskademux.link(h264parse) - pipeline.set_state(gst.STATE_PLAYING) - -matroskademux.connect('no-more-pads', on_new_demux_pad) - -pipeline.set_state(gst.STATE_PAUSED) - - -bus = pipeline.get_bus() -msg = bus.timed_pop_filtered(gst.CLOCK_TIME_NONE, - gst.MESSAGE_ERROR | gst.MESSAGE_EOS) -print msg - -pipeline.set_state(gst.STATE_NULL) diff --git a/scripts/test720p.sh b/scripts/test720p.sh deleted file mode 100755 index 5b16ea0..0000000 --- a/scripts/test720p.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - - -MIXERFORMAT='video/x-raw-rgb, bpp=(int)32, endianness=(int)4321, format=(fourcc)BGRA, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)1280, height=(int)720, framerate=(fraction)24/1, pixel-aspect-ratio=(fraction)1/1, interlaced=(boolean)false' -SRC="filesrc location=../videos/tears_of_steel_720p.mkv ! matroskademux ! h264parse ! ffdec_h264" -SCALE='ffmpegcolorspace ! videoscale ! ffmpegcolorspace' -gst-launch-0.10 -v \ - $SRC !\ - $SCALE !\ - $MIXERFORMAT !\ - ximagesink - diff --git a/scripts/test720pCam.py b/scripts/test720pCam.py deleted file mode 100644 index d0e6201..0000000 --- a/scripts/test720pCam.py +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/env python2 -import pygst -pygst.require('0.10') -import gst - -width = 1280 -height = 720 -framerate = 25 -pipe = "/tmp/feed1" -shm_size = 10000000 - - -MIXERFORMAT = 'video/x-raw-rgb, bpp=(int)32, endianness=(int)4321, format=(fourcc)BGRA, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)%d, height=(int)%d, framerate=(fraction)%d/1, pixel-aspect-ratio=(fraction)1/1, interlaced=(boolean)false' % (width, height, framerate) - -SRC = 'rtspsrc location=rtsp://192.168.1.100 ! rtph264depay ! h264parse ! ffdec_h264' -SCALE = 'ffmpegcolorspace ! videorate ! videoscale ! ffmpegcolorspace' -SINK = 'shmsink socket-path=%s shm-size=%d wait-for-connection=0' % (pipe, shm_size) -#SINK = "ximagesink" - -pipeline = gst.parse_launch('%s ! %s ! %s ! %s' % (SRC, SCALE, MIXERFORMAT, SINK)) - -pipeline.set_state(gst.STATE_PLAYING) - -bus = pipeline.get_bus() -msg = bus.timed_pop_filtered(gst.CLOCK_TIME_NONE, - gst.MESSAGE_ERROR | gst.MESSAGE_EOS) -print msg - -pipeline.set_state(gst.STATE_NULL) diff --git a/scripts/test720pCam.sh b/scripts/test720pCam.sh deleted file mode 100755 index 5d9ebbe..0000000 --- a/scripts/test720pCam.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - - -MIXERFORMAT='video/x-raw-rgb, bpp=(int)32, endianness=(int)4321, format=(fourcc)BGRA, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)1280, height=(int)720, framerate=(fraction)60/1, pixel-aspect-ratio=(fraction)1/1, interlaced=(boolean)false' - -SRC="rtspsrc location=rtsp://192.168.1.100 ! rtph264depay ! h264parse ! ffdec_h264" -SCALE='ffmpegcolorspace ! videorate ! videoscale ! ffmpegcolorspace' - -SINK='ximagesink' -SINK='shmsink socket-path=/tmp/feed1 shm-size=10000 wait-for-connection=0' - - - -gst-launch-0.10 -v \ - $SRC !\ - $SCALE !\ - $MIXERFORMAT !\ - $SINK - diff --git a/scripts/test720pfeed.sh b/scripts/test720pfeed.sh deleted file mode 100644 index 2eaf9fe..0000000 --- a/scripts/test720pfeed.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - - -MIXERFORMAT='video/x-raw-rgb, bpp=(int)32, endianness=(int)4321, format=(fourcc)BGRA, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)1280, height=(int)720, framerate=(fraction)24/1, pixel-aspect-ratio=(fraction)1/1, interlaced=(boolean)false' -SRC="filesrc location=../videos/tears_of_steel_720p.mkv ! matroskademux ! h264parse ! ffdec_h264" -SCALE='ffmpegcolorspace ! videoscale ! ffmpegcolorspace' -gst-launch-0.10 -v \ - $SRC !\ - $SCALE !\ - $MIXERFORMAT !\ - shmsink socket-path=/tmp/feed1 shm-size=10000000 wait-for-connection=0 - diff --git a/scripts/testnetwork.sh b/scripts/testnetwork.sh deleted file mode 100644 index 405f272..0000000 --- a/scripts/testnetwork.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -MIXERFORMAT='video/x-raw-rgb, bpp=(int)32, endianness=(int)4321, format=(fourcc)BGRA, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)1280, height=(int)720, framerate=(fraction)24/1, pixel-aspect-ratio=(fraction)1/1, interlaced=(boolean)false' - -SRC='videotestsrc pattern=snow horizontal-speed=25' - -SCALE='ffmpegcolorspace ! videoscale ! ffmpegcolorspace' - -NETWORK='queue ! timeoverlay ! ffmpegcolorspace ! x264enc tune="zerolatency" ! mpegtsmux ! tcpserversink host=0.0.0.0 port=6666' - -gst-launch-0.10 -v \ - $SRC !\ - $SCALE !\ - $MIXERFORMAT !\ - $NETWORK - diff --git a/scripts/testvideo.sh b/scripts/testvideo.sh deleted file mode 100755 index e243fd3..0000000 --- a/scripts/testvideo.sh +++ /dev/null @@ -1 +0,0 @@ -./video2feed.sh /tmp/feed1 ../videos/LES_TDS_launch.mp4 \ No newline at end of file diff --git a/scripts/tonetwork.sh b/scripts/tonetwork.sh deleted file mode 100644 index 70e8eee..0000000 --- a/scripts/tonetwork.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -MIXERFORMAT='video/x-raw-rgb, bpp=(int)32, endianness=(int)4321, format=(fourcc)BGRA, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)1280, height=(int)720, framerate=(fraction)24/1, pixel-aspect-ratio=(fraction)1/1, interlaced=(boolean)false' - -SRC="filesrc location=../videos/tears_of_steel_720p.mkv ! matroskademux ! h264parse ! ffdec_h264" - -SCALE='ffmpegcolorspace ! videoscale ! ffmpegcolorspace' - -NETWORK='timeoverlay ! ffmpegcolorspace ! x264enc tune="zerolatency" ! mpegtsmux ! tcpserversink host=0.0.0.0 port=6666' - -gst-launch-0.10 -v \ - $SRC !\ - $SCALE !\ - $MIXERFORMAT !\ - $NETWORK - diff --git a/scripts/video2feed.sh b/scripts/video2feed.sh deleted file mode 100755 index 8375577..0000000 --- a/scripts/video2feed.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -# Deliver a video file as input feed - -if [ -z "$1" -o -z "$2" ]; then - echo "Usage $0