project.android.imageprocessing.helper
Class ImageToVideoCreator

java.lang.Object
  extended by project.android.imageprocessing.helper.ImageToVideoCreator

public class ImageToVideoCreator
extends java.lang.Object

A helper class for video creation.

Author:
Chris Batt

Constructor Summary
ImageToVideoCreator(java.lang.String outputName, int width, int height, int fps)
          Creates a ImageToVideoCreator that outputs to the given outputName with a fixed width, height and fps.
 
Method Summary
 void frameAvailable()
          Should be called when a new frame has been draw to the opengl context.
 int getHeight()
          Returns the height of the video being recorded.
 int getWidth()
          Returns the width of the video being recorded.
 void startRecording()
          Starts the recording of the video
 void stopRecording()
          Stops recording the video and finalizes it.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageToVideoCreator

public ImageToVideoCreator(java.lang.String outputName,
                           int width,
                           int height,
                           int fps)
Creates a ImageToVideoCreator that outputs to the given outputName with a fixed width, height and fps.

Parameters:
outputName - The output file name and path to render the output to.
width - The width of the video being produced.
height - The height of the video being produced.
fps - The frames per second of the video being produced.
Method Detail

startRecording

public void startRecording()
                    throws com.googlecode.javacv.FrameRecorder.Exception
Starts the recording of the video

Throws:
com.googlecode.javacv.FrameRecorder.Exception - Exceptions may be thrown from trying to start the recorder.

frameAvailable

public void frameAvailable()
                    throws com.googlecode.javacv.FrameRecorder.Exception
Should be called when a new frame has been draw to the opengl context. Will read the current opengl frame buffer and record it as a frame.

Throws:
com.googlecode.javacv.FrameRecorder.Exception - Exceptions may be thrown from trying to record a frame

stopRecording

public void stopRecording()
                   throws com.googlecode.javacv.FrameRecorder.Exception
Stops recording the video and finalizes it.

Throws:
com.googlecode.javacv.FrameRecorder.Exception - Exceptions may be thrown from trying to stop the recording

getWidth

public int getWidth()
Returns the width of the video being recorded.

Returns:
width The width of the video being recorded

getHeight

public int getHeight()
Returns the height of the video being recorded.

Returns:
height The height of the video being recorded