Merge branch 'master' of github.com:LongHairedHacker/htt-video

This commit is contained in:
Sebastian 2014-05-29 09:29:07 +02:00
commit ae347c33bb
5 changed files with 70 additions and 8 deletions

View File

@ -29,12 +29,23 @@ feed idle 0 1 frames/test_1024x768
# Keep size of input feeds to same size as feed 0
# otherwise things explode.
feed add 1 Feed #1
feed add 1 Feed1
feed geometry 1 1024 768
feed live 1
feed idle 1 100 frames/test_1024x768
feed socket 1 /tmp/feed1
feed add 2 Feed2
feed geometry 2 1024 768
feed live 2
feed idle 2 100 frames/test_1024x768
feed socket 2 /tmp/feed2
feed add 3 Feed3
feed geometry 3 1024 768
feed live 3
feed idle 3 100 frames/test_1024x768
feed socket 3 /tmp/feed3
######################
# Virtual feeds
@ -46,7 +57,7 @@ feed socket 1 /tmp/feed1
# Starts maximized
# Minimized position: 800 20
# Minimized size: 205 154
virtual feed add 1 Feed #1
virtual feed add 1 VirtualFeed #1
virtual feed source feed 1 1
virtual feed place rect 1 20 20 1024 768 0 0 0.0 0.75 0.75 1.0
@ -55,15 +66,15 @@ virtual feed place rect 1 20 20 1024 768 0 0 0.0 0.75 0.75 1.0
# Minimized position: 800 231
# Minimized size: 205 154
virtual feed add 2 Feed #2
virtual feed source feed 2 1
virtual feed source feed 2 2
virtual feed place rect 2 800 230 1024 768 0 0 0.0 0.20 0.20 1.0
# Feed 3
# Starts minimized
# Minimized position: 800 442
# Minimized size: 205 154
virtual feed add 3 Feed #3
virtual feed source feed 3 1
virtual feed add 3 VirtualFeed #3
virtual feed source feed 3 3
virtual feed place rect 3 800 442 1024 768 0 0 0.0 0.20 0.20 1.0
@ -213,4 +224,4 @@ command end
overlay finish Show
#montor on
#montor on

2
scripts/cam2.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
./cam2feed.sh /tmp/feed2 "http://gstreamer:GlytEnru@192.168.50.101/videostream.cgi?rate=0"

2
scripts/cam3.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
./cam2feed.sh /tmp/feed3 "http://gstreamer:GlytEnru@192.168.50.102/videostream.cgi?rate=0"

View File

@ -1,4 +1,4 @@
MIXERCAPS='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'
MIXERCAPS='video/x-raw-rgb, width=(int)1024, height=(int)768'
gst-launch-0.10 -v souphttpsrc location=http://schumb:frederik@192.168.11.10/videostream.cgi?rate=0 ! jpegdec ! ffmpegcolorspace ! videoscale ! ffmpegcolorspace ! $MIXERCAPS ! ximagesink
gst-launch-0.10 -v souphttpsrc location=http://gstreamer:GlytEnru@$1/videostream.cgi?rate=0 ! jpegdec ! ffmpegcolorspace ! videoscale ! ffmpegcolorspace ! $MIXERCAPS ! ximagesink

47
scripts/output2network Executable file
View File

@ -0,0 +1,47 @@
#!/bin/bash
# Deliver mixer1 output to screen.
# Taken from the original snowmix sources
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
VIDEOCONVERT="ffmpegcolorspace ! x264enc ! rtph264pay"
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=1024, height=768'
while true ; do
gst-launch-0.10 -v shmsrc socket-path=$ctrsocket do-timestamp=true is-live=true ! \
$MIXERFORMAT ! \
videoscale ! \
$OUTPUTFORMAT ! \
$VIDEOCONVERT ! \
udpsink host=laptop port=5000
sleep 2
done