need good way to create screencast

Alan Pope alan at canonical.com
Mon Nov 21 10:21:22 UTC 2011


On 20/11/11 23:01, Jason Paul Joines wrote:
> I've tried using istanbul, gtk-recordmydesktop, recorditnow, and
> recordmydesktop. In each case the video and audio get out of sync. I've
> tried every combination of settings I could find via Google in any forum
> post, YouTube video, bug report, etc., but nothing works.
>

I've tried pretty much every tool there is to record the Linux desktop. 
They all suck in one way or another, all of them. So I looked around and 
cobbled together bits and bobs to make reliable, high quality screencasts.

I compiled ffmpeg with support for nasty non-free codecs and wrote a 
little script which uses ffmpeg, sox and parec to record the screen, the 
sound from a microphone and the sound from the computer. It smooshes 
them together in a .mkv file into something you can a) edit, b) publish, 
_easily_.

It creates beautiful lossless videos even at quite high resolutions 
(1920x1080 [1080p] for example) and doesn't place a massive load on the 
system whilst doing it. It's way more reliable than RecordMyDesktop and 
because I used a fixed set of debs, I know it works without having to 
depend too much on the moving target of the Ubuntu repos.

It works best on Intel based video cards or on nVidia cards running 
nouveau (not the binary nVidia one). There's significant graphical 
corruption on nVidia binary because (I believe that) the capture stuff 
can't get in between X and the video card, so don't capture all screen 
deltas (or something). So you end up with chunks of the screen not 
updating, especially in high-speed movement like switching desktops or 
windows appearing/disappearing. I haven't tested ATI/AMD cards at all.

Here's a couple of examples which I recorded and uploaded to youtube 
with no editing or post processing.

http://www.youtube.com/watch?v=e6MQrCmc6HY
http://www.youtube.com/watch?v=BUlyqeYMPxs

They're both 1080p, recorded on my Core i7 desktop, however lower spec 
machines should be able to record fine too. 720p is a nice resolution to 
record at, because it's still "HD" but not so big as to need a giant 
screen or video acceleration just to play it. However if you're gonna 
stick them on youtube who cares? They do the re-encoding for you, you 
just chuck up the highest resolution you can.

The process would be more complex than just "record and upload" for you 
if you want to cut it up and add in transitions and slides between one 
step and the next.

SETUP
~~~~~

I tend to setup a clean install (or at the very least a clean new user 
ID) in which I record the videos (not those two above because they were 
just showing off a bug). I believe people like tutorials to show off 
what they are most likely to see, the default desktop.

I then install the ffmpeg debs which I put here:-

* TODO: make a PPA of these

http://popey.com/~alan/screencasting/debs/

Then grab the ffmpeg screencasting script:-

* TODO: put this in bzr or something? (will people contribute?)

http://popey.com/~alan/screencasting/scripts/ffscreencast.sh

Put that somewhere and make it executable (like /usr/local/bin/)

Open pulse audio mixer and ensure whatever microphone is working 
(assuming you want to record audio).

RECORDING
~~~~~~~~~

I like not having to edit, which means I don't like having to cut the 
start and end of a video where you see the person start and stop the 
recording app/script.

So I ssh into the machine doing the recording and run "ffscreencast.sh" 
via ssh. As soon as the script starts it's recording (give or take half 
a second). It tries to figure out your screen resolution from xrandr and 
sets that as the recording size (i.e. it will record full screen only).

Once it's running, do your stuff and then press "q" in the ssh session 
to stop it.

By default the videos get put in ~/Videos/YYYY/MM/DD/ and will be called 
HHMMSS-final.mkv. There will also be a ~/Videos/YYYY/MM/DD/archive which 
contains the master video and audio before they get smooshed together by 
the script.

You should be able to play the mkv video in totem, or upload to youtube, 
or edit in pitivi, openshot or whatever.

The result is an h.264 video and aac audio file in a mkv file.

Make sense?

Questions/comments/feedback very welcome!

Cheers,
Al.




More information about the ubuntu-users mailing list