Exotic Ideas..
Angad's Blog
About this blog
I am Angad Singh. I have served as the Sun Campus Ambassador of JIIT University, Noida (India) from August 2007 to July 2008 and as a Campus Ambassador Tech Lead from July 2008 to July 2009. This was my sun blog. Here I jotted down all my random scribblings, reports on all activities I conducted as CA at my university, my little projects, hacks, geeky stuff and new technology I came across, all the way to things I learnt in my exciting journey with Sun..
About Me
View Angad Singh's profile on LinkedIn
Technorati Authority
View blog authority
Subscribe
Search

10 Recent Entries
Archives
« December 2009
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  
       
Today
Links
My..
Blogs that interest me
 

Today's Page Hits: 498

Best Viewed in..

Mozilla Firefox

Locations of visitors to this page
« Sun powers the Olymp... | Main | Wondertown: Wonderla... »
Sunday Aug 17, 2008
Screencasting on Solaris
Today I worked to find a solution on screencasting in Solaris. For those unaware of the common term, screencasting simply means digitally recording the computer screen for any purpose, usually recorded to demonstrate features of a software or helping someone solve a technical problem. It has probably been derived from the podcast / vidcast terminology to depict its analogy to nature of these other media. If you're a Netbeans user you would be well aware of the scores of screencasts Netbeans evangelists keep coming up with to demonstrate specific IDE features like the Netbeans 6.1 Javascript Editor and Netbeans 6.5 PHP support screencasts by Roumen Strobl. The Netbeans community screencasts so much that there is an entire website dedicated to showcasing the best of the best of all those screencasts, Netbeans.tv. Ofcourse there are screencasts on OpenSolaris technologies and one such is the screencast on how to setup a  singe node cluster with Sun's Open High Availability Cluster (OHAC) - for those who would want to learn visually instead of reading through the scary manual. Screencasting is fun and I've always followed the practice of making screencasts of project milestones and important updates starting at school projects, then at university and now for open source development. It's much easier than describing something textually - a screencast is worth a thousand blogs. (just being consistent with the original saying, not exactly in the order of a thousand in this case ofcourse!).

On Windows, we have a plethora of screencasting solutions including Wink, Camtasia, etc, some of which are free while others commercial. I personally preferred using Camtasia as it provides every feature you'd need - from adding text callouts, editing after recording, exporting a range of formats, etc. On Linux, we have recordMyDesktop, Istanbul, xVidCap. Now the real problem has been to be able to do this on Solaris! Googling took me to a well-written blog post on a Sun employee's attempt to create a screencasting toolchain for Solaris, which uses a Python based screencasting application called vnc2swf. That's what landed me to a solution. It's concept is unique:
  1. Start xVnc (vncserver) on host system
  2. Start vnc2swf, with the server's IP address and port as parameters. vnc2swf wraps around a VNC client which will then connect to the server and get the screen to record. It will then record the screen into SWF format (Adobe Flash). Neat!
You can pass along parameters like the desired framerate, resolution, whether you want to see the screen also while recording (in case the server is on another computer on the internet/network), etc.

Then there's another python script which comes along with the package called edit.py. It lets you do post-processing of your recorded SWF file - extracting specific frames, converting to other formats (mpeg, flv, frame sequence of images supported), converting resolution / framerate and most importantly - attaching audio to the recording. If you have to record voice along with the screencast, just pass the solaris audiorecord command as a subprocess (-s parameter to vnc2swf) and it will record whatever is your default recording device settable by ossxmix, etc.

Here's my first screencast on Solaris. It was done on Solaris Express Developer's Edition (Build 86), at a resolution of 1280x800 and framerate of 30 FPS. I later converted it to 640x480 and FLV format for the purpose of uploading it. Here's a youtube version in fast-forward mode if you're impatient to see the long one.


For getting this up and running all you have to do is:
  1. Make sure you have VNC server installed. I used the "Remote Desktop" feature in GNOME. I also tried the default vncserver installation in SXDE. xVnc is at /usr/X11/bin/xVnc and vncserver is at /usr/bin/vncserver. Make sure you add /usr/X11/bin to your path to be able to run vncserver. To run the server, run the command : vncserver and it'll create configuration files at $HOME/.vnc. You may set the default apps that run on your VNC desktop by entering them into $HOME/.vnc/xstartup. You could ofcourse go with the Remote Desktop route to avoid all this and be able to record the entire real desktop screen. (vncserver and vncviewer are both also available on blastwave)
  2. Install pyvnc2swf: To be able to run vnc2swf you have to install a few dependencies first:
    1. Fetch the following from blastwave:

      # pkg-get -i python -i pil -i sox -i libsdl -i sdlimage -i sdlttf.
    2. Download pyGame and install it by cd'ing to its folder and running:

      #/opt/csw/bin/python setup.py

      In case it outputs some errors (which it did in my case), just edit the "Setup" file and comment out the modules which are not building. It needs SDL and related libraries which we fetched above from blastwave.
    3. If you want to be able to convert your videos to MPEG using edit.py then also download, build and install pyMedia.

    That's it. Just download pyvnc2swf and read docs/pyvnc2swf.html for instructions on how to use vnc2swf.py and edit.py. To generate the HTML file you'll use html_templates.py. There's also a shell script to be able to record a particular window at bin/recordwin.sh. Note that you can run vnc2swf.py in both CLI and GUI mode (CLI is really a plus).
Alternatively, you could just use the C version of vnc2swf. The differences are mentioned over here, the most important being there's no editor, and its completely CLI (no GUI), but that's not a problem at all - and the C version has a viewer!

Now I have a simple and effective way of creating screencasts on Solaris, without doing any dirty tricks like running it in a VM on Windows or VNC'ing to it from a remote Linux box and using recordMyDesktop. This works perfectly even with compiz fusion doing all its effect magic.

An interesting thing is that the original blogger who proposed this idea also posted about a 300$ bounty which he'll give to anyone who would come up with an open-source pure Java solution to this problem using a java-based VNC client and java-based SWF processing API's -- way back in 2005. I guess the bounty period is now over, but the solution hasn't yet come. Any takers? ;)
Posted at 01:36AM Aug 17, 2008 by Angad Singh in OpenSolaris  |  Comments[4]  |  del.icio.us digg slashdot technorati Stumble It! Share on Facebook furl reddit Share on Twitter    

Comments:

Interesting can you show an example of audio track synced with the video that works with the subprocess command you mentioned. When viewing screen cast demo's it expected to have an audio track. Examples of screen casts without audio are just less than useless.

---Bob

Posted by Bob Palowoda on August 17, 2008 at 03:06 AM IST #

Hi Angad, thanks for mentioning my NetBeans screencasts :) I plan to record some screencasts for OpenSolaris, too. I want to use Camtasia together with VirtualBox + OpenSolaris 2008.05 running in full screen in VirtualBox. Not an open source solution, but it should work well (I really need good editing tools to make the screencast perfect).

Posted by Roman Strobl on August 17, 2008 at 01:14 PM IST #

This is real cool stuff

Posted by Tirthankar on August 17, 2008 at 05:23 PM IST #

Good Stuff Dude.

Posted by Amit on August 18, 2008 at 10:14 AM IST #

Post a Comment:
  • HTML Syntax: NOT allowed
Creative Commons License

This work by Angad Singh is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.