CaptureVideo Xtra
current version 0.1a
Copyright Geoff Smith 1999-2002
page last updated:June 2002

ALPHA VERSION XTRA
T his is very early code - use entirely at your own risk


OS9
OSX

To purchase please contact
sales@physicalbits.com

Description

This is a sprite Xtra for use in Macromedia's Director (TM) multimedia program. Currently only for windows.

Installation

Windows: Copy the VideoCapture.x32 file to the "Program Files\Macromedia\Director X\Xtras" folder. Then start Director.
To create new member use the "insert/physicalbits Xtras/VideoCapture" menu item. If correctly installed the xtra will appear in the insert menu, under the physicalbits heading; as below.


Location of VideoCapture Xtra in insert menu

Basic operation

A. Insert VideoCapture from menu
B. Drag onto stage. If sprite boundary is green then all is ok, is red problem with video capture
C. Use "captureVideoOpen( member X,0)"
D. Use "set the captureEnabled of member X to 1"
E. Run the movie - image should appear on stage
F. When finished it is important, specially i=on Win98, to use "captureVideoClose(member X)"

 

Member Properties

All properties are accessed via the member. eg set the captureFPS of member 1 to 15

Group

Name

data

Set

Get

Description

Capture

     
 
 

captureFilename

string

o

o
Set the path and name of the file to capture into
 

captureToFile

true or false

o

o
Enable/disable the capture to a file
 

captureToSprite

true or false

o

o
Enable/disable the updating of the capture to a sprite
  captureRect rect
o
o
Set/get the capture rect of the capture device.

Control

     
 
  captureVideoIndex integer
o
The driver index to the device
  captureEnabled true or false
o
o
Start/stop thecapture process
  captureToStage true or false
o
  Set the image preview on/off
  directToStage true or false     True to send captured image directl to stage, faster update, but no compositing with other sprites
 

captureFPS

float

o

Change the number of frames per second the capture device will try to capture
 

captureSingleFrameMode

true or false

NYI
Info      
 
  captureVersion  
o
NYI
  audiodevices list  
o
Returns a list of all the installed audio devices
  videodevices list  
o
Returns a list of all the installed video devices
  videocompressors list  
o
Returns a list of all the installed video compressors
  captureRect rect   o Returns the current capture rectangle

Private

     
 

DebugMessages

integer

o

 
         

 

Member Messages

All properties are accessed via the member. eg CaptureOpen( member 1)

Group

Function

Description

Control

   
 

captureVideoOpen( member ref)
captureVideoOpen( member ref, videoIndex)
captureVideoOpen( member ref, videoIndex, audioIndex)

Open the specfied device, intialize the connection.
  captureVideoClose( member ref ) Close the connection to an open device
  Poll Certain functions require time to process data, call this regularly
Capture    
  TimedCaptureToFile Capture to a disk file for the specified duration.
 

SingleFrameCapture( member ref)

NYI

 

TrimCaptureImage( member ref, rect)

NYI

Dialogs    
  showdisplaydialog  
  showsourcedialog  
  showformatdialog  
  showcompressiondialog  

 

Version release history

VideoCapture Member Properties


captureFilename

Format

captureFilename pathAndFilename

Parameter

pathAndFilename is a string that indicates where to save any captured images of movies

Default value

"VideoCap.avi"

Access

Set

o
 

Get

o

 

Example

set the captureFilename of member 1 to "c:\myDocs\history\movie.avi"

Description

To set the name of the file to stream the captured video/audio data. Change this before using captureToFile. To start the movie saving use the captureToFile property


captureToFile

Format

captureToFile trueOrFalse

Parameter

trueOrFalse is a true or false value.

Default value

false

Access

Set

o
 

Get

o

 

Example

set the captureToStage of member 1 to true

Description

Enables or disables the capture to a file. Has no effect until captureEnable has been set true. Each time it changes from false to true the file is written from the begging, overwriting the previous contents.


captureToSprite

Format

captureToSprite trueOrFalse

Parameter

trueOrFalse is a true or false value.

Default value

true

Access

Set

o
 

Get

o

 

Example

set the captureToSprite of member 1 to true

Description

Enables or disables the capture to a sprite. Has no effect until captureEnable has been set true.


captureVideoIndex

Format

captureVideoIndex index

Parameter

index is the index of the video camera to use for input.

Default value

0

Access

Set

 

Get

o

 

Example

put the captureVideoIndex of member 1

Description

Supplies the index of the currently open video driver device

captureFPS

Format

captureFPS float

Parameter

float is a number that the capture system attempts to aquire new frames. It is in frames per second.

Default value

15.0

Access

Set

o
 

Get

 

 

Example

set the captureFPS of member 1 to 13

Description

Sets the current frames per second for the video capture. This might not be achieveable, eg setting 500.5 frames a sec! You can set sub-second capture rates, eg .2 is 1 frame every 5 seconds.


captureEnabled

Format

captureEnabled bool

Parameter

bool true or false value

Default value

false

Access

Set

o
 

Get

o

 

Example

set the captureEnabled of member 1 to true

Description

Starts the capture engine working. Until this is set true no display of capture is possible.


captureVersion

Format

captureVersion

Parameter

none

Default value

n/a

Access

Set

 

Get

o

 

Example

put the captureVersion of member 1

Description

Gets the current version of the Xtra

 

 

VideoCapture Functions detail

captureVideoOpen

This starts the video capture, if captureToStage and/or are set the image will be send to those devices

Format

OpenCapture( member ref)
OpenCapture( member ref, videoIndex )
OpenCapture( member ref, videoIndex, audioIndex)

Parameters member ref - a member identifier eg member 1
videoIndex - an id or index to a video device, 0=default/scan
audioIndex- an id or index to an audio device, 0=default/scan
Return value "ok" or error message
Description Opens the video and audio devices, but does not start capture. Use captureEnabled to start
Example OpenCapture( member 1 of cast 3 )
Notes  


captureVideoClose

This starts the video capture, if captureToStage and/or are set the image will be send to those devices

Format

CloseCapture( member ref)

Parameters member ref - a member identifier eg member 1
Return value "ok" or error message
Description Close the video and audio devices. Use captureEnabled to stop
Example CloseCapture( member 1 of cast 3 )
Notes If captureEnabled=true and captureToFile=true then the file is closed.

 

Dialogs

This starts the video capture, if captureToStage and/or are set the image will be send to those devices

Format

showdisplaydialog( member ref)
showsourcedialog( member ref)
showformatdialog( member ref)
showcompressiondialog( member ref)

Parameters member ref - a member identifier eg member 1
Return value "ok" or error message
Description Display one of the system dialogs to allow the user to change the settings
Example showsourcedialog( member 1 of cast 3 )
Notes  

 

TimedCaptureToFile

This starts the video capture, if captureToStage and/or are set the image will be send to those devices

Format

TimedCaptureToFile( member ref, duration)

Parameters member ref - a member identifier eg member 1
duration - integer, duration to capture to file in milliseconds
Return value "ok" or error message
Description Capture to a disk file for the specified duration.
Example TimedCaptureToFile( member 1 of cast 3,10000 )
Notes  

 

Combing the capture properties

OpenCapture
captureToStage
captureToFile
 
no
False
False
No images or audio being captured or stored.
yes
False
False
Capture system active and buffering image to memory. The memory buffer is one frame long. This must be true before the other properties have any meaning.
yes
True
False
Capture system active and associated sprite, if any, will be updated.
yes
False
True
Capture system active and the associated file is updated. Any sprites will not be updated.
yes
True
True
Capture system active and the associated file and any sprites are updated.

 

 

Version History

Version

Date

Notes

0.1a

3/01

Initial

 

Contact details

Email: support@physicalbits.com

Conditions of use

In this document Xtra refers to this Xtra, and me refers to Geoff Smith. All rights to the XObject/Xtra are retained by me. The XObject may be used in any MacroMedia Director document for personal use and given to your friends. All documentation must be included when passing on the XObject/Xtra. Unless licensed you may NOT do the following ·distribute for profit without prior permission. ·distribute for profit within a Director presentation without prior permission ·distribute by CD-ROM without prior permission. ·distribute as part of a collection without prior permission ·be used in a public presentation without prior permission.Financial liabilty for this product is limited to the purchase price or $1, whichever is greater.
All legal proceeding must be carried out under the auspices of the court of Santa Clara, California, USA. These conditions may be modified at any time. Please refer to the physicalbits website for the latest conditions.