aboutsummaryrefslogtreecommitdiff
path: root/start-streaming
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-01-13 15:37:49 -0200
committerSilvio Rhatto <rhatto@riseup.net>2013-01-13 15:37:49 -0200
commit454c6e3c77b3db507ee81875219089047fc2d5a3 (patch)
tree34ea351902ddd6094bc0a96a65b4bc07e9ee83d8 /start-streaming
downloadscripts-454c6e3c77b3db507ee81875219089047fc2d5a3.tar.gz
scripts-454c6e3c77b3db507ee81875219089047fc2d5a3.tar.bz2
Initial import
Diffstat (limited to 'start-streaming')
-rwxr-xr-xstart-streaming65
1 files changed, 65 insertions, 0 deletions
diff --git a/start-streaming b/start-streaming
new file mode 100755
index 0000000..b324c55
--- /dev/null
+++ b/start-streaming
@@ -0,0 +1,65 @@
+#!/bin/bash
+#
+# thanks to rafael at riseup.net and
+# http://current.workingdirectory.net/posts/2010/video4linux-and-audio/
+# http://mcs.hackitectura.net/tiki-index.php?page=live+stream+with+gstreamer
+# https://en.wikibooks.org/wiki/Puredyne/Stream_Audio_and_Video#Gstreamer
+# http://wm161.net/2011/03/02/anchorman/
+#
+# needed packages: v4l-utils gstreamer-tools
+#
+# Example config:
+#
+# SERVER="icecast.example.org"
+# PORT="8000"
+# PASS="hackme"
+# MOUNT="mount.ogv"
+# NAME="Stream"
+# DESC="Description"
+# GENRE="Genre"
+# URL="http://example.org"
+
+# Parameters
+DATE="`date +%Y%m%d%H%M%S`"
+BASE="~/.start-streaming"
+CONFIG="$1"
+
+# Parsing
+if [ -z "$CONFIG" ]; then
+ echo "usage: `basename $0` <config>"
+ exit 1
+fi
+
+mkdir -p $BASE
+
+if [ ! -f "$BASE/$CONFIG.conf" ]; then
+ echo "error: no $BASE/$CONFIG.conf found"
+ exit 1
+fi
+
+source $BASE/$CONFIG.conf
+
+#v4l2-ctl --set-input 1
+
+# Video source: screen
+gst-launch ximagesrc ! queue ! textoverlay text="$DESC" font-desc="50px" ! queue ! ffmpegcolorspace ! videoscale ! video/x-raw-yuv,width=320,height=240 ! theoraenc bitrate=100 ! queue ! oggmux name=mux alsasrc ! queue ! audioconvert ! vorbisenc bitrate=48000 ! queue ! mux. mux. ! tee name=tt ! queue ! filesink location=$DATE-$MOUNT tt. ! queue ! shout2send ip=$SERVER port=$PORT password=$PASS mount=/$MOUNT streamname="$NAME" description="$DESC" genre="$GENRE" url=$URL
+
+# Video source: camera
+#gst-launch v4l2src ! queue ! textoverlay text="$DESC" font-desc="50px" ! queue ! ffmpegcolorspace ! videoscale ! video/x-raw-yuv,width=320,height=240 ! theoraenc bitrate=100 ! queue ! oggmux name=mux alsasrc ! queue ! audioconvert ! vorbisenc bitrate=48000 ! queue ! mux. mux. ! tee name=tt ! queue ! filesink location=$DATE-$MOUNT tt. ! queue ! shout2send ip=$SERVER port=$PORT password=$PASS mount=/$MOUNT streamname="$NAME" description="$DESC" genre="$GENRE" url=$URL
+
+# norm=NTSC does not work on debian squeeze
+#gst-launch v4l2src norm=NTSC ! queue ! textoverlay text="$DESC" font-desc="50px" ! queue ! ffmpegcolorspace ! videoscale ! video/x-raw-yuv,width=320,height=240 ! theoraenc bitrate=100 ! queue ! oggmux name=mux alsasrc ! queue ! audioconvert ! vorbisenc bitrate=48000 ! queue ! mux. mux. ! tee name=tt ! queue ! filesink location=$MOUNT tt. ! queue ! shout2send ip=$SERVER port=$PORT password=$PASS mount=/$MOUNT streamname="$NAME" description="$DESC" genre="$GENRE" url=$URL
+
+#gst-launch v4l2src norm=NTSC ! queue ! ffmpegcolorspace ! videoscale ! video/x-raw-yuv,width=320,height=240 ! theoraenc bitrate=100 ! queue ! oggmux name=mux alsasrc ! queue ! audioconvert ! vorbisenc bitrate=48000 ! queue ! mux. mux. ! tee name=tt ! queue ! filesink location=$MOUNT tt. ! queue ! shout2send ip=$SERVER port=$PORT password=$PASS mount=/$MOUNT streamname="$NAME" description="$DESC" genre="$GENRE" url=$URL
+
+#gst-launch v4l2src norm=NTSC ! queue ! ffmpegcolorspace ! videoscale ! video/x-raw-yuv,width=320,height=240 ! theoraenc bitrate=100 ! queue ! oggmux name=mux alsasrc ! queue ! audioconvert ! vorbisenc bitrate=48000 ! queue ! mux. mux. ! queue ! shout2send ip=$SERVER port=$PORT password=$PASS mount=/$MOUNT streamname="$NAME" description="$DESC" genre="$GENRE" url=$URL
+
+#gst-launch v4l2src norm=NTSC ! queue ! ffmpegcolorspace ! videoscale ! video/x-raw-yuv,width=320,height=240 ! theoraenc bitrate=100 ! queue ! oggmux name=mux alsasrc ! queue ! audioconvert ! vorbisenc bitrate=48000 ! queue ! mux. mux. ! queue ! shout2send ip=orelha.radiolivre.org port=8000 password=SENHA mount=/MOUNT.ogv
+
+# gst-launch v4l2src ! queue ! ffmpegcolorspace ! videoscale ! video/x-raw-yuv,width=320,height=240 ! tee name=tscreen ! queue ! autovideosink tscreen. ! queue ! videorate ! video/x-raw-yuv,framerate=25/2 ! queue ! theoraenc quality=16 ! queue ! oggmux name=mux alsasrc ! queue ! audioconvert ! vorbisenc quality=0.2 ! queue ! queue ! mux. mux. ! queue ! tee name=tfile ! queue ! filesink location=stream.ogg tfile. ! queue ! shout2send ip=icecast.server port=8000 mount=test.ogg password=secret
+
+# gst-launch-0.10 webmmux name=mux streamable=true ! queue2 ! shout2send mount=/test.webm port=8000 password=teste ip=173.255.215.196 v4l2src ! video/x-raw-yuv,width=320,height=240 ! ffmpegcolorspace ! vp8enc bitrate=96000 threads=6 ! queue2 ! mux.video_0 alsasrc ! audio/x-raw-int,rate=24000,channels=1 ! queue2 ! audioconvert ! vorbisenc max-bitrate=48000 ! queue2 ! mux.audio_0
+
+# gst-launch-0.10 webmmux name=mux streamable=true ! queue2 ! shout2send mount=/test.webm port=8000 password=teste ip=173.255.215.196 v4l2src ! video/x-raw-yuv,width=320,height=240 ! ffmpegcolorspace ! vp8enc bitrate=96000 threads=6 ! queue2 ! mux.video_0 audiotestsrc ! audioconvert ! vorbisenc max-bitrate=48000 ! queue2 ! mux.audio_0
+
+# gst-launch-0.10 webmmux name=mux streamable=true ! queue2 ! shout2send mount=/test.webm port=8000 password=teste ip=173.255.215.196 v4l2src ! video/x-raw-yuv,width=320,height=240 ! ffmpegcolorspace ! vp8enc bitrate=96000 threads=0 ! queue2 ! mux.video_0 pulsesrc device="alsa_input.pci-0000_00_1b.0.analog-stereo" ! audioconvert ! vorbisenc max-bitrate=48000 ! queue2 ! mux.audio_0