Sunday, 20 May 2012

XWD: how to take SCREENSHOTS in X WINDOW SYSTEM


A screenshot is an image taken from the monitor screen.
It could comprise whole screen or a smaller part of it, usually a window.

XWD TOOL


X Window System provides an utility to dump images from a X Window: xwd.

xwd stores window images in a special format "xwdump".
This format can be used by other X tools too.


Other tools are also available:
convert from ImageMagick, KSnapshot, gnome-screenshot, ...


We install xwd (in debian, ubuntu):
$ sudo aptitude install x11-apps


CAPTURE WHOLE SCREEN


We could capture entire screen or some window only.
Whole screen in X Window System is associated also to a window: the root window.

Getting root window screenshots:

Sunday, 6 May 2012

Convert videos to VP6 codec format using MENCODER


This post shows how to encode a video file into VP6 codec, using mencoder program.

As a result we will create a FLV (Macromedia flash player) media file (instead of an avi file)


We will get "On2 VP6" video codec driver from a windows dll.

Mencoder is a tool provided by MPlayer to encode movies, and convert between file formats and codecs.


INSTALL MENCODER


First we obtain mencoder tool.

In debian:
$ sudo aptitude install mencoder

Current mencoder version when this article was written:
Version: 2:1.0~rc4.dfsg1+svn34540-1+b1

Another way to get mencoder could be installing from source code.


OBTAIN BINARY CODECS


Binary codecs come separately from mencoder. We can download them from MPlayer pages:
http://www.mplayerhq.hu/design7/dload.html
http://www.mplayerhq.hu/MPlayer/releases/codecs/

To see if a codec is supported:
http://www.mplayerhq.hu/DOCS/codecs-status.html


I have an amd64 architecture but I have to download ESSENTIAL CODECS for X86 anyway:
$ wget www.mplayerhq.hu/MPlayer/releases/codecs/essential-20071007.tar.bz2
$ tar xvjf essential-20071007.tar.bz2

The windows dll we need is this (check it does appear):
vp6vfw.dll


Next we place binary codecs in a directory where mplayer or mencoder can access them:
$ sudo mkdir /usr/lib/codecs
$ sudo cp -v essential-20071007/* /usr/lib/codecs/
NOTE: if you installed mplayer from source location could be: /usr/local/lib/codecs


CONFIGURING VP6 SETTINGS