org.nees.buffalo
Class flexTPSRecorder

java.lang.Object
  extended by org.nees.buffalo.flexTPSRecorder

public class flexTPSRecorder
extends Object

flexTPSRecorder is a class (and application) to record JPEG snapshots of a set of streams from a flexTPS server. This class is mainly for recording time-lapse video so the recording rate (or period) should be slow. On the order of seconds, minutes, or hours.

The snapshots will be saved to disk (in the optional specified directory) using the filename format: <feed>-<stream>_<timestamp>.jpg.

Author:
Jason P. Hanley
See Also:
flexTPS Homepage

Constructor Summary
flexTPSRecorder()
          Create a recorder to save a single set of images from the flexTPS server at localhost, in the current directory.
flexTPSRecorder(String hostname)
          Create a recorder to save a single set of images from the flexTPS server at hostname, in the current directory.
flexTPSRecorder(String hostname, double period)
          Create a recorder to save images from the flexTPS server at hostname, and at the specified period, in the current directory.
flexTPSRecorder(String hostname, double period, File directory)
          Create a recorder to save images from the flexTPS server at hostname, at the specified period, in the specified directory.
 
Method Summary
 boolean isRecording()
          Indicates if video streams are being recorded.
 boolean login(String username, String password)
          Login into the flexTPS server with the given username and password.
static void main(String[] args)
          Runs flexTPSRecorder with the specified command link arguments.
 void setStreams(List<String> streams)
          Set the streams to be recorded.
 void start()
          Start recording the video streams to disk.
 void stop()
          Stops recording of video.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

flexTPSRecorder

public flexTPSRecorder()
Create a recorder to save a single set of images from the flexTPS server at localhost, in the current directory.


flexTPSRecorder

public flexTPSRecorder(String hostname)
Create a recorder to save a single set of images from the flexTPS server at hostname, in the current directory.

Parameters:
hostname - the hostname of the flexTPS server

flexTPSRecorder

public flexTPSRecorder(String hostname,
                       double period)
Create a recorder to save images from the flexTPS server at hostname, and at the specified period, in the current directory.

If the period is 0, only a single set of images will be saved.

Parameters:
hostname - the hostname of the flexTPS server
period - the period (in seconds) between snapshots

flexTPSRecorder

public flexTPSRecorder(String hostname,
                       double period,
                       File directory)
Create a recorder to save images from the flexTPS server at hostname, at the specified period, in the specified directory.

If the period is 0, only a single set of images will be saved.

Parameters:
hostname - the hostname of the flexTPS server
period - the period (in seconds) between snapshots
directory - the directory to save the snapshots in
Method Detail

login

public boolean login(String username,
                     String password)
Login into the flexTPS server with the given username and password. This function will return true if the login succeeded, or false otherwise.

Parameters:
username - the username to login with
password - the password for the username accout
Returns:
true if the login succeeded, false otherwise

setStreams

public void setStreams(List<String> streams)
Set the streams to be recorded. This is a list of stream names in the form of <feed>-<stream>.

Parameters:
streams - a list of stream name to record

start

public void start()
Start recording the video streams to disk. This records all active video streams unless a list of streams was specified by calling setStreams.

See Also:
stop(), setStreams(List)

stop

public void stop()
Stops recording of video. If start has not been called, or has finished, this will do nothing.

If the recorder is in the process of saving an image, the recording will be stopped when the image has been saved.

See Also:
start(), isRecording()

isRecording

public boolean isRecording()
Indicates if video streams are being recorded.

Returns:
true if recording, false otherwise
See Also:
start(), stop()

main

public static void main(String[] args)
Runs flexTPSRecorder with the specified command link arguments. Specifiy the '-?' command line argument to see a list of available options.

Parameters:
args - the command line arguments.