Screencasting via Gstreamer from Python (Playing with streaming media on Linux...)

Rather than charge back into doing work on Cinemon when it's late, I decided to focus instead on one of the side projects that's been sitting there in the project for a while, namely producing a screencast of basic usage for Cinemon. I'm considering one for the VoIP project as well.

What I want is to produce a simple MPEG or similar readily available cross-platform format generated from a Linux desktop capture as a simple downloadable file (eventually with a voice-over). There's a project called "Instanbul" that seems pretty close, but it produces Ogg Theora output, and last I looked the support for Ogg Theora on most platforms was poor or non-existent.

So, I decided to look into gstreamer. It's really very similar to the Windows streaming video mechanism, so much of the material was somewhat old hat. Anyway, have now put together a screencast base class that does the core recording work, along with a simplistic command-line runner. The core class currently produces AVI-packaged MS-MPEG4v3 (DivX) screencasts, I'm thinking that all needs to be handled via configuration settings.

I haven't got a handle yet of how to make the ximagesrc produce higher-frame-rate video source, so the screencast is rather jerky. I want it around 10fps, but it seems to capture at about 1 or 2 fps. I'm assuming this isn't a problem with the "iterate" being called from Python, though it does seem to take forever for iterate to return each time (i.e. half a second or more). Also need to get audio input added so that commentary can be recorded at the same time.

Hint for those wanting to work with the framework. Documentation is rather lacking for the plugins, so you'll have to use gst-inspect (which you'll want to symlink to gst-inspect-0.8) to find/inspect them.

One annoying little realisation is that Gentoo packages just about every significant plugin as a separate ebuild, so you wind up having to emerge half a dozen plugins to have a reasonable set for development work. Oh well, once you realise that it's straightforward.

Anyway, it's rather late, so I suppose I'll head off to bed.


  1. Matt Good

    Matt Good on 12/14/2005 12:27 p.m. #

    Well, Istanbul is already written using Python and Gstreamer. Swapping Theora for another video format should be fairly straightforward since the encoding is all defined in Gstreamer pipelines in the source. Search for "theoraenc" and "oggmux" in the source and change that part of the pipeline to encode it in your desired format.

  2. Mike Fletcher

    Mike Fletcher on 12/14/2005 5 p.m. #

    Thanks for the tip. Didn't even think of hacking on it (I generally don't work on GPL projects). Oh well, at least I'm learning the api.

  3. Niki Spahiev

    Niki Spahiev on 12/15/2005 4:54 a.m. #

    You can check pyvnc2swf<br />

Comments are closed.


Pingbacks are closed.