From ac932b2bd1af3cb0eccfae13b057765ca3484ceb Mon Sep 17 00:00:00 2001
From: =?utf8?q?Einar=20J=C3=B8rgen=20Haraldseid?= <einar@haraldseid.net>
Date: Mon, 19 Aug 2013 21:30:29 +0200
Subject: [PATCH] "Patch" to support gstreamer 1.0

---
 screencast.sh | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/screencast.sh b/screencast.sh
index a207dde..40a204d 100755
--- a/screencast.sh
+++ b/screencast.sh
@@ -11,8 +11,11 @@
 # and microphone in separate audio streams.
 #
 # You also get to choose to record from the whole screen or just a specified
-# window. It has been tested on Fedora 18 and CrunchBang Waldorf (and thus
-# should work on Debian Wheezy as well).
+# window. It has been tested on Fedora 18, Ubuntu 13.04 and CrunchBang Waldorf
+# (and thus should work on Debian Wheezy as well).
+#
+# If you're using GStreamer 1.0, please jump to the bottom of the script
+# and comment out the gst-launch-0.10 pipeline and uncomment the 1.0 pipeline.
 #
 # It dumps the recording in your $HOME directory with a filename like
 # screencast-YYYY-MM-DD-HH-MM-SS.mp4
@@ -122,12 +125,19 @@ if [ ${MIC} != "none" ]; then
    ! audiorate ! audioconvert ! ffenc_aac bitrate=256000 ! queue2 ! mux."
 fi
 
-# Launch gstreamer
-gst-launch -q -e ximagesrc xid="${WID}" do-timestamp=1 use-damage=0 \
+# Launch gstreamer (Using gstreamer 0.10)
+gst-launch-0.10 -q -e ximagesrc xid="${WID}" do-timestamp=1 use-damage=0 \
  ! video/x-raw-rgb,framerate=30/1 ! ffmpegcolorspace  ! videoscale method=0 \
  ! video/x-raw-yuv,width=${WIDTH},height=${HEIGHT} \
  ! x264enc speed-preset=veryfast bitrate=${BITRATE} ! queue2 \
  ! mp4mux name="mux" \
- ! filesink location="${HOME}/${FILENAME}" $MONITORARG $MICARG
+ ! filesink location="${HOME}/${FILENAME}" ${MONITORARG} ${MICARG}
+
+# Launch gstreamer (Using gstreamer 1.0)
+#gst-launch-1.0 -q -e ximagesrc xid="${WID}" do-timestamp=1 use-damage=0 \
+# ! video/x-raw,framerate=30/1 ! videoscale method=0 \
+# ! video/x-raw,width=${WIDTH},height=${HEIGHT} ! videoconvert \
+# ! x264enc speed-preset=veryfast bitrate=${BITRATE} ! queue2 \
+# ! filesink location="${HOME}/${FILENAME}" ${MONITORARG} ${MICARG}
 
 echo "Recording done, file is ${FILENAME}"
-- 
2.30.2