git.slaskete.net
/
einar-bin
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
f485c33
)
Dropped legacy gstreamer-0.10 stuff, added check for aac encoder
author
Einar Jørgen Haraldseid
<einar@haraldseid.net>
Mon, 25 Jun 2018 13:51:07 +0000
(15:51 +0200)
committer
Einar Jørgen Haraldseid
<einar@haraldseid.net>
Mon, 25 Jun 2018 13:51:07 +0000
(15:51 +0200)
screencast.sh
patch
|
blob
|
history
diff --git
a/screencast.sh
b/screencast.sh
index 40a204d6bf5f3d530122f107eeb9b75d612446ec..7a06a8cc7e304e73bf0792a3f0bd8d4be88c3957 100755
(executable)
--- a/
screencast.sh
+++ b/
screencast.sh
@@
-14,9
+14,6
@@
# window. It has been tested on Fedora 18, Ubuntu 13.04 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
#
# It dumps the recording in your $HOME directory with a filename like
# screencast-YYYY-MM-DD-HH-MM-SS.mp4
#
@@
-115,29
+112,28
@@
BITRATE=$(echo "${WIDTH} * ${HEIGHT} * 0.0075" | bc | cut -d "." -f 1 )
# Set file name.
FILENAME="screencast-$(date +%F-%H-%M-%S).mp4"
# Set file name.
FILENAME="screencast-$(date +%F-%H-%M-%S).mp4"
+# Determine if we have ffenc_aac or avenc_aac available
+AACENC="ffenc_aac"
+if gst-inspect-1.0 --exists avenc_aac; then
+ AACENC="avenc_aac"
+fi
+
# Enable inputs as suitable
if [ ${PLAYMON} != "none" ]; then
MONITORARG="pulsesrc device=${PLAYMON} slave-method=0 provide-clock=false \
# Enable inputs as suitable
if [ ${PLAYMON} != "none" ]; then
MONITORARG="pulsesrc device=${PLAYMON} slave-method=0 provide-clock=false \
- ! audiorate ! audioconvert !
ffenc_aac
bitrate=256000 ! queue2 ! mux."
+ ! audiorate ! audioconvert !
${AACENC}
bitrate=256000 ! queue2 ! mux."
fi
if [ ${MIC} != "none" ]; then
MICARG="pulsesrc device=${MIC} slave-method=0 provide-clock=false \
fi
if [ ${MIC} != "none" ]; then
MICARG="pulsesrc device=${MIC} slave-method=0 provide-clock=false \
- ! audiorate ! audioconvert !
ffenc_aac
bitrate=256000 ! queue2 ! mux."
+ ! audiorate ! audioconvert !
${AACENC}
bitrate=256000 ! queue2 ! mux."
fi
fi
-# Launch gstreamer
(Using gstreamer 0.10)
-gst-launch-
0.1
0 -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}
\
+# Launch gstreamer
+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 \
! mp4mux name="mux" \
! filesink location="${HOME}/${FILENAME}" ${MONITORARG} ${MICARG}
! x264enc speed-preset=veryfast bitrate=${BITRATE} ! queue2 \
! mp4mux name="mux" \
! 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}"
echo "Recording done, file is ${FILENAME}"