David преди 9 години
родител
ревизия
c7a0f97d88
променени са 2 файла, в които са добавени 26 реда и са изтрити 17 реда
  1. 14 14
      camera1/cam-to-udp.sh
  2. 12 3
      camera1/mic-to-udp.sh

+ 14 - 14
camera1/cam-to-udp.sh

@@ -1,14 +1,7 @@
 #!/bin/bash
 
-if [ $# -lt 1 ]; then
-	echo "1/2 arg, target host (120,151?) [options]"
-	echo "where options is a set of {proj,trat}"
-	exit 1
-fi
-
-#HOST="$1"
 HOST="224.1.1.1"
-#shift
+HOST="192.168.2.255"
 set -e
 
 fps=24
@@ -22,7 +15,7 @@ w=800
 h=600
 
 roi="roi-x=0.00 roi-y=0 roi-w=1.00 roi-h=1.00"
-bitrate=1000000
+bitrate=600000
 
 novideo="-n"
 PREVIEW="preview=0"
@@ -35,9 +28,9 @@ while [ $# -gt 0 ]; do
 	fi
 	if [ "$1" == "trat" ]; then
 		echo "trat!"
-		roitrat="roi-x=0.35 roi-y=0 roi-w=0.65 roi-h=0.65"
-		roitrat="roi-x=0.25 roi-y=0 roi-w=0.75 roi-h=0.75"
-		roitrat="roi-x=0.25 roi-y=0.25 roi-w=0.5 roi-h=0.5" #centered?
+		roitrat="roi-x=0.12 roi-y=0.12 roi-w=0.75 roi-h=0.75"
+		roitrat="roi-x=0.25 roi-y=0.25 roi-w=0.50 roi-h=0.50"
+		roitrat="roi-x=0.19 roi-y=0.19 roi-w=0.62 roi-h=0.62"
 		roi=$roitrat
 	fi
 	shift
@@ -49,5 +42,12 @@ done
 FORMAT="video/x-h264, width=$w, height=$h, framerate=24/1, profile=high"
 #annotation-mode=0x8 
 rotation=180
-echo gst-launch-1.0 rpicamsrc rotation=$rotation $PREVIEW $roi bitrate=$bitrate do-timestamp=true ! queue ! $FORMAT ! h264parse ! rtph264pay config-interval=1 ! udpsink host=$HOST auto-multicast=true port=5000
-     gst-launch-1.0 rpicamsrc rotation=$rotation $PREVIEW $roi bitrate=$bitrate do-timestamp=true ! queue ! $FORMAT ! h264parse ! rtph264pay config-interval=1 ! udpsink host=$HOST auto-multicast=true port=5000
+
+HOST="192.168.2.120:5000,192.168.2.155:5000,192.168.2.68:5000"
+echo gst-launch-1.0 rpicamsrc rotation=$rotation $PREVIEW $roi bitrate=$bitrate do-timestamp=true ! queue ! $FORMAT ! h264parse ! rtph264pay config-interval=1 ! multiudpsink clients=$HOST
+     gst-launch-1.0 rpicamsrc rotation=$rotation $PREVIEW $roi bitrate=$bitrate do-timestamp=true ! queue ! $FORMAT ! h264parse ! rtph264pay config-interval=1 ! multiudpsink clients=$HOST
+#echo gst-launch-1.0 rpicamsrc rotation=$rotation $PREVIEW $roi bitrate=$bitrate do-timestamp=true ! queue ! $FORMAT ! h264parse ! rtph264pay config-interval=1 ! udpsink host=$HOST port=5000
+#     gst-launch-1.0 rpicamsrc rotation=$rotation $PREVIEW $roi bitrate=$bitrate do-timestamp=true ! queue ! $FORMAT ! h264parse ! rtph264pay config-interval=1 ! udpsink host=$HOST port=5000
+
+#echo gst-launch-1.0 rpicamsrc rotation=$rotation $PREVIEW $roi bitrate=$bitrate do-timestamp=true ! queue ! $FORMAT ! h264parse ! rtph264pay config-interval=1 ! udpsink host=$HOST auto-multicast=true port=5000
+#     gst-launch-1.0 rpicamsrc rotation=$rotation $PREVIEW $roi bitrate=$bitrate do-timestamp=true ! queue ! $FORMAT ! h264parse ! rtph264pay config-interval=1 ! udpsink host=$HOST auto-multicast=true port=5000

+ 12 - 3
camera1/mic-to-udp.sh

@@ -1,8 +1,17 @@
 #!/bin/bash
 
 HOST="224.1.1.1"
-echo gst-launch-1.0 alsasrc ! audioconvert ! audioresample ! mulawenc ! rtppcmupay ! udpsink host=$HOST port=5001
-	 gst-launch-1.0 alsasrc ! audioconvert ! audioresample ! mulawenc ! rtppcmupay ! udpsink host=$HOST auto-multicast=true port=5001
-#gst-launch-1.0 alsasrc slave-method=0 ! audioconvert ! audioresample ! alawenc ! rtppcmapay ! udpsink host=$1 port=5001
+HOST="192.168.2.255"
+enc="vorbisenc"
+enc="mulawenc ! rtppcmupay"
+
+#echo gst-launch-1.0 alsasrc ! audioconvert ! audiorate tolerance=20000000 ! audioresample ! $enc ! udpsink host=$HOST auto-multicast=true port=5001
+#	 gst-launch-1.0 alsasrc ! audioconvert ! audiorate tolerance=20000000 ! audioresample ! $enc ! udpsink host=$HOST auto-multicast=true port=5001
+HOST="192.168.2.120:5001,192.168.2.155:5001,192.168.2.68:5001"
+echo gst-launch-1.0 alsasrc ! audioconvert ! audiorate tolerance=20000000 ! audioresample ! $enc ! multiudpsink clients=$HOST
+	 gst-launch-1.0 alsasrc ! audioconvert ! audiorate tolerance=20000000 ! audioresample ! $enc ! multiudpsink clients=$HOST
+#echo gst-launch-1.0 alsasrc ! audioconvert ! audiorate tolerance=20000000 ! audioresample ! $enc ! udpsink host=$HOST port=5001
+#	 gst-launch-1.0 alsasrc ! audioconvert ! audiorate tolerance=20000000 ! audioresample ! $enc ! udpsink host=$HOST port=5001
 
+#gst-launch-1.0 alsasrc slave-method=0 ! audioconvert ! audioresample ! alawenc ! rtppcmapay ! udpsink host=$1 port=5001
 #gst-launch-1.0 alsasrc ! audioconvert ! audioresample ! alawenc ! rtppcmapay ! udpsink host=