my ideas in action
Screencast with FFMPEG with sound (Ubuntu 12.04 / Mint 13)
December 25, 2012Posted by on
This is how to make a high quality screencast with sound from the soundcard.
Great if you want to record for example screencast tutorial or a webpage that contains sound.
system: Ubuntu 12.04/ Mint 13
- Record without sound, image size relative to dimensions of your screen (my case is 1600×900):
ffmpeg -f x11grab -s 1600×900 -r 25 -i :0.0 -sameq output.mkv
- Record with sound, from your microphone:
ffmpeg -f alsa -i pulse -ab 192 -acodec pcm_s16le -f x11grab -s 1600×900 -r 25 -i :0.0 -sameq output.mkv
To record with sound, from your microphone you have to do also the following steps ( only first time):
* Install Pulse Audio Volume Control. (through synaptic package manager)
* Repeat the second command, recording starts.
* Go to Pulse Audio; go to the tab ‘Recording’, it shows ffmpeg recording the sound. Change the pull down menu to Monitor from Built in Analog Stereo.
Now it records the sound stream in stead of your micro. Set your microphone sound level to the desired values.
That is basically it.
After you save the file you will need to cut first few seconds and last few seconds to remove the parts where you start/stop the ffmpeg command.
This can be done with the below command.
Basically in the below example I extract from “output.mkv” the video starting from second 10 . The length of the output file (clip-output-file.mkv) is set to 120seconds.
ffmpeg -ss 10 -t 120 -i output.mkv -acodec copy -vcodec copy clip-output-file.mkv