SourceForge.net Logo

CamIt

Copyright (C) 2002 - 2003 Daniel Gehriger (gehriger@linkcad.com)

Check out our other software:

Content:

Installation of CamIt

Note: The files mentioned in this section are in the "setup" folder of the CamIt source distribution.

CamIt runs on Windows 98 and Me; Windows NT4 (Service Pack 3 or higher), 2000 and XP.

The following steps must be performed in order to run CamIt (see the README.txt file of the source code distribution for details) :

Recording

Syntax

Command line options come in two flavors: the short one-letter form and a long form. Short options are preceded by a single dash character (-), long options by two dashes (--). Example :

camit -h (short option)
camit --help (long option)

Some options take an argument, which must follow the option after a space character, or, for long options only, after an equal (=) sign :

camit -o test.wmv
camit --output test.wmv
camit --output=test.wmv

If the argument contains space characters, it must be quoted :

camit --ouput="C:\My Documents\test.wmv"

Recording can be stopped, paused or continued by three means:

Command Line Reference

To start recording, CamIt must be given an output file name. The minium command line is therefore :

camit --output="C:\My Documents\test.wmv"

It follows a description of the options. Uppercase words stand for the the argument to the options.

Short Option Long Option Description
-h --help Displays a short command line reference.
-v --verbose Write progress messages to the console. For debugging purposes.
-o FILE --output=FILE Selects the filename (and path) of the recorded file. CamIt ensures that the file has a .wmv extension, and adds the extension if needed. If the output file cannot by created, an error message is displayed an CamIt exits.
-O FILE --output-size=FILE Same as above, but CamIt inserts the dimensions of the recorded video in the output filename. Ex: if you specify --output-size="test", the generated file is named "test[1240x1024].wmv".
-A --disable-acceleration Temporarily disable hardware acceleration during recording. The original setting will be restored when camit exits. The display goes black for about a second while the hardware acceleration is changed.
-t TITLE
-a AUTHOR
-n COPYRIGHT
-D DESCRIPTION
--title=TITLE
--author=AUTHOR
--copyright=COPYRIGHT
--description=DESCRIPTION
Sets the corresponding attribute in the output file. This information is visible in the Windows Media Player when playing the recorded file.
-C FILE --cursor=FILE Loads a custom cursor from a .cur, .ico or .ani file, and replaces the cursor in the recorded file with it. The custom cursor will not be visible during recording.
-u TITLE --window-title=TITLE Records only the window whose title bar displays "TITLE". The window may be moved around. The recorded area corresponds to the initial window size, that is, if the window is enlarged during the recording session, only part of it will be recorded. Recording is paused if the window is invisible, but sound recording continues.
-N --window-select Same as above, but the user can interactively select the recorded window.
-Y --no-caption-buttons Disables the recording controls in the window titlebars.
-F --full-screen Records the entire desktop.
-S --select-area Lets user interactively select the recorded screen area.
-W WIDTH
-H HEIGHT
--width=WIDTH
--height=HEIGHT
Specifies the dimensions of the recorded screen area, but lets user interactively select the position.
-r COLOR
-s COLOR
--frame-color-1=COLOR
--frame-color-2=COLOR
During recording, a flashing frame is displayed outside the recorded area. These options select the two frame colors. Colors are specified in HTML style, that is as rrggbb.
-w WIDTH
-
l LENGTH
--frame-width=WIDTH
--frame-length=LENGTH
Specifies the width and length of the flashing frame.
-p SHAPE
-e SIZE
-g COLOR
--hilite-shape=SHAPE
--hilite-size=SIZE
--hilite-color=COLOR
Highlights the cursor by drawing a colored shape around it. Possible values for SHAPE are: "circle", "ellipse", "square" and "rectangle". Default is "none".
-T HOTKEY
-U HOTKEY
-X HOTKEY
--hotkey-stop=HOTKEY
--hotkey-pause=HOTKEY
--hotkey-resume=HOTKEY
Sets the hotkeys for stopping, pausing and resuming recording. The syntax is:
MODIFIER-KEY, where MODIFIER is one or a combination of "CTRL", "SHIFT", "ALT", "WIN" (the Windows key), separated by a dash. KEY is either a letter, a number or F1 through F12.
-F FPS --fps=FPS Sets the captured screen frames per second. The default is 2.
-B BITS --color-depth=BITS Forces the recording to either 16, 24 or 32 bit colors. The default is 16 bits. If set to -1, the current screen setting will be used.
-c CODEC --video-codec=CODEC Selects the video codec by its four-cc code. The default is the Windows Media Screen V7 codec, which is lossless and optimized for capturing computer screens. To display a list of alternative codecs and their four-cc codes, use "camit -d".
-q QUALITY --video-quality=QUALITY Lossy codecs (e.g.. MPEG-4) can trade of quality for size. Range is 0 - 100.
-b BITRATE --video-bitrate=BITRATE Specifies the target video bitrate (bits per second). The WMV file size is proportional to the selected bitrate. Smaller bitrates require more CPU time, as the codec needs to work harder.
-k SECONDS --key-frame-period=SECONDS Seconds between key frames. Key frames contain an entire captured image, whereas normal frames only store the difference between the previous frame. Default: 8 seconds.
-R --show-rec-volumes Opens the Windows recording volume control panel and exits.
-z --show-rec-devices Opens the Windows recording devices control panel and exits.
-y --audio-disable Disable audio recording.
-I ID --audio-device=ID Selects the recording device. The default is to use the system default device, as specified in the audio recording control panel (see -z option). To get a list of valid device IDs, use "camit -i".
-K CODEC --audio-codec=CODEC Selects the audio codec. Valid values are "ACELPnet" and "WMAudio". The default codec ACELPnet is voice only. WMAudio is a general purpose codec.
-m FREQUENCY --audio-sampling-rate=FREQ Specifies the sampling rate, in samples per second. The sampling rate must be at least twice as large as the highest recorded frequency. Default is 16000, which is suitable for voice only.
-J CHANNELS --audio-channels=CHANNELS Specifies either mono (1 channel) or stereo (2 channels) recording.
-L BITS --audio-resolution=BITS Specifies the bit resolution of each audio sample. Either 8 or 16 bits (default).

Playback

Windows Media Player (MP) is required to play the recorded .wmv files. Windows Media Player 7.1 includes all required codecs. Earlier versions have to download and install the Windows Screen Codec before the recordings can be viewed.  MP 6.0 and later will automatically connect to the Internet and download the required software. Otherwise, use the wmpcdcs8.exe file to pre-install the required codecs.

Window 98 (2nd Edition / SE) comes with Windows Media Player 6.0 preinstalled. Unfortunately, this version does not recognize the .wmv extension. The solution
is to either rename the .wmv files to .asf (which is the old extension for this format), or to open the file by selecting "All Files (*.*)" in the player's Open File Dialog.

Window NT 4.0 doesn't include the Media Player. Furthermore, MP 7.1 cannot be installed on NT4, only Media Player 6.4. The codecs must therefore be installed manually (see above).

Microsoft Media Player download site: http://www.microsoft.com/windows/windowsmedia/download/default.asp.

Compilation

CamIt requires either

VC6 requires the latest service pack to be installed, which can be downloaded from http://msdn.microsoft.com/vstudio/downloads/updates/sp/vs6/sp5/default.asp. Select the "CamIt" project as the default project, and build everything. The resulting binary will be placed in either the "ReleaseVC6" or "ReleaseVC7" folder. CamIt consists of

and won't run if either part is missing.

For detailed compilation instructions, read the README.txt file in the source code distribution!

Code Overview

The camit sources are located in three directories:

The sources for the hook.dll are in the .\hook subdirectory.

The main program entry is in main.cpp. It parse the command line arguments using the ArgsInfo class, contained in ArgsInfo.h/cpp. It then creates a single instance of the CamIt class (CamIt.h/cpp).

Screen capturing is performed by the Grabber (Grabber.h/cpp) class. FrameGrabber (FrameGrabber.cpp/h) sets up a worker thread that repeatedly uses Grabber to create screen shots. The created images are put in a queue (SafeQueue, SaveQueue.h).

Sound recording is performed by WaveRecorder (WaveRecorder.h/cpp). The class creates a worker thread for this purpose, and pushes the blocks of recorded sound samples in yet another SafeQueue.

CamIt  is notified whenever a new sample/frame is added to the respective queues, and sends the buffers to the WMFile (WMFile.h/cpp), the wrapper around the WMF recording SDK.