aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-09-18 16:36:46 -0300
committerSilvio Rhatto <user@example.org>2014-09-18 16:36:46 -0300
commita7b7344e602a17bc0b6946db1122d18d3b4f6288 (patch)
tree8412dfb5c082958f8a6851fc0105440182259ce9
downloadstart-streaming-a7b7344e602a17bc0b6946db1122d18d3b4f6288.tar.gz
start-streaming-a7b7344e602a17bc0b6946db1122d18d3b4f6288.tar.bz2
Initial import
-rw-r--r--README.md0
-rw-r--r--TODO.md0
-rwxr-xr-xstart-streaming54
3 files changed, 54 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/README.md
diff --git a/TODO.md b/TODO.md
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TODO.md
diff --git a/start-streaming b/start-streaming
new file mode 100755
index 0000000..e6acd07
--- /dev/null
+++ b/start-streaming
@@ -0,0 +1,54 @@
+#!/bin/bash
+#
+# GStreamer command line wrapper
+#
+# Thanks to rafael at riseup.net and the following documents:
+#
+# 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="~/.config/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