I didn't made many screencasts, but the most usual complaint I hear is about the lack of a soundtrack, people request a spoken explanation for the actions happening on screen or at least some music. Now way I will include a spoken audio track, but since I know about acceptable music with a clear license, I can do that.
So for a recent screencast I tried to silence the critics by adding a music track, which by consequence forced me to add a "credits" screen, to satisfy the license requirements (CC-BY-SA), resulting in a somewhat complicated editing operation, something deserving to be documented and shared. Keep in mind that my target was to upload the file to YouTube, so a number of compromises were considered acceptable.
Now tot he tools: PiTiVi is crap and I don't say it lightly, not only it lacks the features I needed (and will document in the following paragraphs), but the only thing it seems able to do is crash as soon as I hit the "Redner project" button, so my only option was to use the arcane but efficient Mencoder, cutting some corners, like using DivX as a video codec, mp3 as audio coded and AVI as a container. If someone can come with an alternate recipe, keeping the formats Free, I will use that in the future, if the solution involves a GTK GUI, most likely I exclusively use that...
So back to the screencast. I recorded it with gtk-RecordMyDesktop, even if Istanbul has a better user interface, its recording is worse: it uses an predefined low quality setting, resulting in a bad looking video and high CPU usage during recording. With RecordMyDesktop set at 100% quality level, you get a smooth recording and a very crisp looking video, nice to have for an original.
So the first step is to transcode the image to MPEG4 (DivX) and at the same time reduce the resolution to 800x500, people will not see it at 1680x1050 (my full screen size) on YouTube and the file size is too large anyway (note: no additional parameters for video encoding, since it will be transcoded to Flash at a worse quality anyway):
mencoder screencast.ogv -oac copy -ovc lavc -vf scale=800:500 -o screencast.avi
My video was too long, 18 minutes, much over the 10 minutes limit allowed by YouTube, so my trick was to speed it up (3 times). Being lazy, I just increased the frame rate, didn't care too much about the file size, as I will upload it just one single time:
mencoder screencast.avi -oac copy -ovc copy -speed 3 -o screencast-fast.avi
For the credits screen I prepared a PNG with Inkscape and multiplied it as many times as the number of frames I needed - 10 seconds at 45 fps = 450 copies (10 seconds is a bit too much, and the 45 fps is the results of the lazy speed-up in the previous step):
seq -w 1 450| while read i; do cp frame.png "frame_0$i.png"; done
Then convert all those PNGs in a video with the same codec and frame rate as my screencast:
mencoder "mf://*.png" -ovc lavc -mf fps=45 -o ending.avi
The next step is to merge the two videos and the image is ready:
mencoder -oac copy -ovc copy screencast-fast.avi ending.avi -o screencast-end.avi
I needed properly licensed music, so I used a track from the Denied by Reign album by Severed Fifth, namely War, which has about the same time duration as my video part. In the same step with adding the music, I transcoded it from Ogg Vorbis to mp3 (as required by the AVI container):
mencoder screencast-end.avi -o screencast-final.avi -ovc copy -oac mp3lame -audiofile severedfifth-deniedbyreign-war.ogg
And that is all, upload to YouTube and enjoy.