encoder
Class Encoder

java.lang.Object
  extended by encoder.Encoder

public class Encoder
extends java.lang.Object

The Encoder class deals with the encoding process.

This class takes a group of video frames as input and does encoding of those frames by using a desired video compression technique and outputs the encoded / compressed set of video frames.

Version:
1.0
Author:
shankar

Constructor Summary
Encoder(java.lang.String folderName, java.lang.String fileName, int imageWidth, int imageHeight, int frameNo, int numberOfFrames, int groupOfFrames, int frameRate, int bitRate, java.lang.String mode)
          Constructs a Encoder initializes LinkedList, Node, Counters and DataFile
 
Method Summary
 void checkStatus(java.lang.String type)
          Checks status of flag generated by internal process or any flag generated by user to stop Encoder Process
 void encode()
          The main Encoder encoding process is handled by encode method
static void main(java.lang.String[] args)
          Main program of the class
static void print(java.lang.Process p, java.lang.String type)
          Prints the input, output and error streams of the process build by ProcessBuilder
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Encoder

public Encoder(java.lang.String folderName,
               java.lang.String fileName,
               int imageWidth,
               int imageHeight,
               int frameNo,
               int numberOfFrames,
               int groupOfFrames,
               int frameRate,
               int bitRate,
               java.lang.String mode)
Constructs a Encoder initializes LinkedList, Node, Counters and DataFile

Parameters:
folderName - path to folder contains frames
fileName - common part of file of frames
imageWidth - of the frame of type int
imageHeight - of the frame of type int
frameNo - starting frame number of type int
numberOfFrames - Total number of the frames
groupOfFrames - number of frames in a group to be processed at a time
frameRate - of the video to feed the frames Integer
bitRate - the target bit rate
mode - String representation of the input like Frames, Video and Cam
Method Detail

encode

public void encode()
The main Encoder encoding process is handled by encode method

encode calculates bitsToRead for Y, Cb and Cr components and writes the data to the header file, reads the raw data and converts them to YCbCr starts the encoding process.


checkStatus

public void checkStatus(java.lang.String type)
Checks status of flag generated by internal process or any flag generated by user to stop Encoder Process

Parameters:
type - String representation of the Process type like camProcess, self

main

public static void main(java.lang.String[] args)
Main program of the class

Parameters:
args -

print

public static void print(java.lang.Process p,
                         java.lang.String type)
Prints the input, output and error streams of the process build by ProcessBuilder

print will redirects the process input, output and error streams of the process

Parameters:
p - is Process
type - is type of stream to print as String