This question already has an answer here:

I have seen this question: How to Record Screen and internal Audio?

The answers given here is to install recordmydesktop. I have installed it but it does not work. It gives a error message just after selecting the screen area.

Also I have many screen recorder applications but none works perfectly. Some records the screen but not the audio. eg EasyScreenCast. I would like to know how to record screen with audio.

marked as duplicate by Charles Green, David Foerster, waltinator, Eric Carvalho, Videonauth Nov 12 '17 at 0:21

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Did you try any of the suggestions in the other answers of the linked question? – David Foerster Nov 11 '17 at 0:02

If RecordMyDesktop does not work properly for you, you can use a script instead.

The script can be found here on GitHub.

To use, copy the script into a text file (use your favourite text editor) and save it in your home directory. Give the script execute permission

chmod 755 name-of-your-file

Then you can execute it easily:


The script:


NAME=screencast-$(date +%Y%m%d%H%M)

echo "Click the window to capture and get ready!"

trap 'touch $tmpfile; rm -f $tmpfile' 0

xwininfo > $tmpfile 2>/dev/null
left=$(grep 'Absolute upper-left X:' $tmpfile | awk '{print $4}');
top=$(grep 'Absolute upper-left Y:' $tmpfile | awk '{print $4}');
width=$(grep 'Width:' $tmpfile | awk '{print $2}');
height=$(grep 'Height:' $tmpfile | awk '{print $2}');
geom="-geometry ${width}x${height}+${left}+${top}"
echo "Geometry: ${geom}"
echo "pos=$pos size=$size"

sleep 2
ffmpeg -y -f alsa -ac 2 -i pulse -f x11grab -r $FPS -s $size -i ${DISPLAY-0:0}+${pos} -acodec pcm_s16le $NAME-temp.wav -an -vcodec libx264 -preset ultrafast -threads 0 $NAME-temp.mp4

echo Merge audio+video and encode to webm for YouTube? && read

ffmpeg -i $NAME-temp.mp4 -i $NAME-temp.wav -acodec libvorbis -ab 128k -ac 2 -vcodec libvpx -qscale 8 -me_method full -mbd rd -flags +gmc+qpel+mv4 -trellis 1 -threads $THREADS $NAME.webm

Usage is also demonstrated in this YouTube video.

Editor's note: please do not give security-risk 777 permissions to the file as shown in the video. 755 will be more than sufficient.

Not the answer you're looking for? Browse other questions tagged or ask your own question.