So, this one time I forgot to turn the mic on during a class I was recoding, and so, no sound. And I thought afterwards, heck, I should write a little script that does all the things I need to do to record a lesson. So this script will turn the mic on, open mypaint, resize the screen, start recording, convert the output and stitch it to me "intro/exit" video byte. All I need to do is run this script and after is a go and the output it saved into my video folder and ready for uploading to youtube. Cool :)
#!/bin/bash
mypaint -f &
x=800;y=600;
xrandr -s \$x"x"\$y
xrandr --output VGA1 --mode \$x"x"\$y
NAME=`date +%d-%m-%Y_%H:%M:%S`
META="(C) Stephen Easley-Walsh www.mathsgrinds.ie"
cd /home/hp/Videos
amixer -q -c 0 sset 'Mic',0 unmute; amixer set Capture 50%; arecord -d 1 > /dev/null
recordmydesktop --on-the-fly-encoding --v_quality=63 --v_bitrate=2000000 --s_quality=10 --quick-subsampling --channels=1 --freq=8000 --stop-shortcut=Control+q --pause-shortcut=Control+p --fps=4 --output=".~~\$NAME.ogv"
ffmpeg -y -vsync 1 -i ".~~\$NAME.ogv" -vf scale=\$x:\$y -c:v libx264 -preset ultrafast -crf 23 -c:a libvorbis -q:a 5 -pix_fmt yuv420p -r 16 -ar 44100 -ac 1 -metadata title="\$META" ".~~\$NAME.mkv"
ffmpeg -y -vsync 1 -i ".Stephen.mp4" -vf scale=\$x:\$y -c:v libx264 -preset ultrafast -crf 23 -c:a libvorbis -q:a 5 -pix_fmt yuv420p -r 16 -ar 44100 -ac 1 -metadata title="\$META" ".Stephen.mkv"
mkvmerge -o "\$NAME.mkv" ".~~\$NAME.mkv" +".Stephen.mkv"
if [ -f "\$NAME.mkv" ]
then
rm ".~~\$NAME.ogv"; rm ".~~\$NAME.mkv"; clear;
fi
killall mypaint
exit
Screencasting
Posted
Author Stephen Easley-Walsh