ffmpeg
Class FFMpeg

java.lang.Object
  extended by ffmpeg.FFMpeg
All Implemented Interfaces:
java.lang.Runnable

public class FFMpeg
extends java.lang.Object
implements java.lang.Runnable

Objects of FFMpeg represant an interface the ffmpeg program

Author:
SebastianWe

Field Summary
static int AUDIO
           
static int VIDEO
           
 
Constructor Summary
FFMpeg(java.lang.String path, Language lang, FFMpegProgressReceiver recv)
          Constructs a new Object of FFMpeg
 
Method Summary
 InputMedium getInputMedium()
          Return the inputMedium
 java.lang.String getPath()
          Returns the path to ffmpeg
 CodecVector getSupportedCodecs()
          Returns a CodecVector of supported Codecs
 java.lang.String[] getSupportedCodecsList(int type)
          Return a String array that represents a Codec List
 void run()
           
 void setInput(java.lang.String input, java.awt.Component caller, FFMpegProgressReceiver recv)
          Sets a new inputMedium
 void setOutput(java.lang.String output, java.lang.String audio, java.lang.String video, java.lang.String aspect, java.lang.String scala, java.lang.String rate, java.lang.String arate, int type, java.lang.String bps, java.lang.String channels)
          Sets a new output medium
 void setPath(java.lang.String path)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AUDIO

public static int AUDIO

VIDEO

public static int VIDEO
Constructor Detail

FFMpeg

public FFMpeg(java.lang.String path,
              Language lang,
              FFMpegProgressReceiver recv)
       throws java.io.IOException
Constructs a new Object of FFMpeg

Parameters:
path - The path to ffmpeg
lang - Language
recv - Receiver of conversion state
Throws:
java.io.IOException - when ffmpeg binary was not found
Method Detail

getSupportedCodecs

public CodecVector getSupportedCodecs()
Returns a CodecVector of supported Codecs

Returns:
CodecVector

getSupportedCodecsList

public java.lang.String[] getSupportedCodecsList(int type)
Return a String array that represents a Codec List

Parameters:
type - specify the kind of codec 1 = audio 2 = video
Returns:
String array of codecs from

setPath

public void setPath(java.lang.String path)
             throws java.io.IOException
Parameters:
path - Path to ffmpeg
Throws:
java.io.IOException - when ffmpeg binary was not found

setInput

public void setInput(java.lang.String input,
                     java.awt.Component caller,
                     FFMpegProgressReceiver recv)
              throws java.io.IOException
Sets a new inputMedium

Parameters:
input - Path to input file
caller - Caller of the method
recv - Download-State Receiver
Throws:
java.io.IOException - when video url is incorrect or there are problems with the input medium format

setOutput

public void setOutput(java.lang.String output,
                      java.lang.String audio,
                      java.lang.String video,
                      java.lang.String aspect,
                      java.lang.String scala,
                      java.lang.String rate,
                      java.lang.String arate,
                      int type,
                      java.lang.String bps,
                      java.lang.String channels)
Sets a new output medium

Parameters:
output - Path to output file
audio - audio codec short description
video - video codec short description
aspect - aspect ratio
scala - scala (e.g. 123x234)
rate - video bitrate
arate - audio bitrate
type - encoding type (vcd, svcd, dvd, user defined[, ...])
bps - frames per second

run

public void run()
Specified by:
run in interface java.lang.Runnable

getInputMedium

public InputMedium getInputMedium()
Return the inputMedium

Returns:
inputMedium or null if no inputMedium is set

getPath

public java.lang.String getPath()
Returns the path to ffmpeg

Returns:
path