NAME
seqgrabber - Create and manipulate a sequence grabber widget for video and audio
SYNOPSIS
package require QuickTimeTcl ?version?
seqgrabber pathname ?options?
WIDGET-SPECIFIC OPTIONS
-audio, audio, Audio
-audioonly, audioOnly, AudioOnly
-file, file, File
-framerate, frameRate, FrameRate
-height, height, Height
-overlayimage, overlayImage, OverlayImage
-playduringrecord, playDuringRecord, PlayDuringRecord
-quality, quality, Quality
-showfps, showFPS, ShowFPS
-size, size, Size
-videocompressor, videoCompressor, VideoCompressor
-volume, volume, Volume
-width, width, Width
-zoom, zoom, Zoom
DESCRIPTION
WIDGET COMMAND
pathName audiosettings
pathName cget option
pathName configure ?option? ?value option value ...?
pathName image procName imageName
pathName pause boolean
pathName picture imageName
pathName record
pathName start
pathName stop
pathName videosettings
BUGS
KEYWORDS

NAME

seqgrabber - Create and manipulate a sequence grabber widget for video and audio

SYNOPSIS

package require QuickTimeTcl ?version?
seqgrabber pathname ?options?

WIDGET-SPECIFIC OPTIONS

Command-Line Name: -audio
Database Name: audio
Database Class: Audio
Specifies if audio be included in the grabber. It defaults to true.

Command-Line Name: -audioonly
Database Name: audioOnly
Database Class: AudioOnly
Boolean that defaults to 0. If 1, then no video grabber is created, only an audio grabber. A widget with -audioonly set shall not be mapped on the display. It is typically used for recording sound only. A minimal recording session reads:
seqgrabber .sg -audioonly 1 -file prat.mov
.sg start
.sg audiosettings
.sg record 
...
.sg stop
Note that, unlike the video grabber, it is necessary to explicitly start the audio grabber.

Command-Line Name: -file
Database Name: file
Database Class: File
Specifies the file path to a file to save any recording results to.

Command-Line Name: -framerate
Database Name: frameRate
Database Class: FrameRate
Specifies the desired framerate when recording. It defaults to 0.0 which I believe means max frame rate.

Command-Line Name: -height
Database Name: height
Database Class: Height
Specifies a desired height for the sequence grabber widget. If this option isn't specified, the sequence grabber's height is computed from the width option and the physical size of the video source in pixel coordinates. The ratio of height to width is kept identical to the corresponding ratio of the video source. If an explicit nonzero value of the width option is lacking, the height is found from the size option and the ratio of the video source height and width. If height is put equal to 0 it is disregarded. Both height and width cannot be set simultaneously. Any combination of the options cannot result in a widget size larger than the physical size of the video source in pixel coordinates. The framerate typically decreases with the size of the widget.

Command-Line Name: -overlayimage
Database Name: overlayImage
Database Class: OverlayImage
(Unimplemented on Windows.) Specifies an existing photo (created via image create photo) that should be displayed on top of the grabbed video sequence or still image. It is usually a small image that is shown in one of the corners, which for the moment defaults to the north east corner. Typically it contains large portions that are transparent. This option cannot be set or changed when the seqgrabber has been mapped on the display.

Command-Line Name: -playduringrecord
Database Name: playDuringRecord
Database Class: PlayDuringRecord
Boolean. Defaults to 1. Specifies if previewing shall be on if recording. Sometimes better performance is achieved if not.

Command-Line Name: -quality
Database Name: quality
Database Class: Quality
Specifies the desired playback quality of the video: fast, normal or high. It defaults to normal. The result can depend on the implementation of the drivers for the specific video source. Note that some (mine at least) fails when qulity is set to high, and just givs a white background.

Command-Line Name: -showfps
Database Name: showFPS
Database Class: ShowFPS
Boolean. Defaults to 0. If 1 a running counter and an estimated frames-per-second figure is drawn in the preview window.

Command-Line Name: -size
Database Name: size
Database Class: Size
Sets the wanted size of the grabbed video in terms of fractions of the physical size of the video source in pixel coordinates. It can be any of three values, full, half, or quarter. It defaults to half. If any of the height or width options has been set they override the size of the size option. Performance may be better if the size option is used instead of the height or width options. The framerate typically decreases with the size of the widget.

Command-Line Name: -videocompressor
Database Name: videoCompressor
Database Class: VideoCompressor
Sets the compressor type when recording video. The compressor is named by a four character text string. See ::quicktimetcl::info for how to find the available components on your system. As a shortcut, use the videosettings, set the wanted compressor there, save, and use cget -videcompressor to get the four character code.

Command-Line Name: -volume
Database Name: volume
Database Class: Volume
Sets the recording volume. It is a number between +1.0 and -1.0. Negative numbers means that sound is off, an is used to toggle on-off.

Command-Line Name: -width
Database Name: width
Database Class: Width
Specifies a desired width for the sequence grabber widget. If this option isn't specified, the sequence grabber's width is computed from the height option and the physical size of the video source in pixel coordinates. The ratio of height to width is kept identical to the corresponding ratio of the video source. If an explicit nonzero value of the height option is lacking, the width is found from the size option and the ratio of the video source height and width. If width is put equal to 0 it is disregarded. Both height and width cannot be set simultaneously. Any combination of the options cannot result in a widget size larger than the physical size of the video source in pixel coordinates. The framerate typically decreases with the size of the widget.

Command-Line Name: -zoom
Database Name: zoom
Database Class: Zoom
The zoom option must be given by a floating point number larger or equal to one (1). The video is zoomed in by this factor but the widget size is kept unchanged. As a result, the video source is clipped. The framerate may increase if the video is zoomed since not the complete video source rectangle needs to be captured.

DESCRIPTION

The sequence grabber widget is a widget for showing and capturing video and audio. Previewing starts automatically when the widget is displayed. It is typically used together with a web camera that has a driver interface to QuickTime. The QuickTime interface is general enough to allow for many types of input devices, such as DV video, for instance. Moreover, it is not limited to a particular hardware port on the computer, such as ADB (serial), USB, or FireWire. The content in the widget is updated "live", but it is possible to just take snapshots. Recording of video and audio to a movie file on disk is also possible. Standard panels for separately setting video and audio parameters are included as commands. Only a single instance of this widget can exist.

WIDGET COMMAND

The seqgrabber command creates a new Tcl command whose name is pathName. This command may be used to invoke various operations on the widget. It has the following general form:
pathName option ?arg arg ...?
Option and the args determine the exact behavior of the command. The following commands are possible for sequence grabber widgets:

pathName audiosettings
Displays the standard QuickTime audio settings panel as a dialog window. The settings are stored internally in QuickTime. It returns 0 if user canceled, 1 if Ok.

pathName cget option
Returns the current value of the configuration option given by option. Option may have any of the values accepted by the seqgrabber command.

pathName configure ?option? ?value option value ...?
Query or modify the configuration options of the widget. If no option is specified, returns a list describing all of the available options for pathName (see Tk_ConfigureInfo for information on the format of this list). If option is specified with no value, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no option is specified). If one or more option-value pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. Option may have any of the values accepted by the seqgrabber command.

pathName image procName imageName
Takes a snapshot asynchronously of the playback video frame and places it in the imageName, which must already exist. Create the imageName with image create photo imageName. The procName must look like:
proc shot {w imageName} {
   ...
}
Note that the image is not written after the pathName image returns, but when the procName is invoked. This is much faster than the picture command. The grabber must be running for this to work.

pathName ispaused
Returns 1 if the preview process is paused, and 0 if it's unpaused. Note that the process may be stopped but still unpaused.

pathName isrunning
Returns 1 if the preview process is neither paused, nor stopped, and 0 else.

pathName pause boolean
Pauses or unpauses the playback in the widget. It doesn't cause any system resources involved to be released so it's a rather "light" task.

pathName picture imageName
Takes a snapshot of the playback video frame and places it in the imageName, which must already exist. Create the imageName with image create photo imageName. See also image

pathName record
Starts recording to the file specified by the file option. A stop or pause command stops the recording.

pathName start
Starts video playback in the widget. The start and stop commands release and allocate system resources. For a short break it is therefore better to use pause. It also resets any paused state to unpause (?).

pathName stop
Stops video playback in the widget. It also stops any recording operations.

pathName videosettings
Displays the standard QuickTime video settings panel as a dialog window. The settings are stored internally in QuickTime. It returns 0 if user canceled, 1 if Ok.

BUGS

It happens that the quality option just stops previewing. Testing on Windows is limited to the emulated 'vdig' (Video Digitizer) component WinVDIG from "http://www.vdig.com". Experience with Connectix QuickCam and Philips ToUcam on Macintosh shows that video drivers are not always as robust as one would wish.

KEYWORDS

Sequence grabber, Movie,QuickTime and tk_getOpenFilePreview
Copyright © 2000-2001 Mats Bengtsson