com.googlecode.fascinator.transformer.ffmpeg
Class FfmpegImpl

java.lang.Object
  extended by com.googlecode.fascinator.transformer.ffmpeg.FfmpegImpl
All Implemented Interfaces:
Ffmpeg

public class FfmpegImpl
extends Object
implements Ffmpeg

Wrapper for the FFMPEG program

Author:
Oliver Lucido

Field Summary
 
Fields inherited from interface com.googlecode.fascinator.transformer.ffmpeg.Ffmpeg
DEFAULT_BIN_METADATA, DEFAULT_BIN_TRANSCODE
 
Constructor Summary
FfmpegImpl()
          Instantiate using default binaries
FfmpegImpl(String executable, String metadata)
          Instantiate using provided binaries (if found)
 
Method Summary
 String extract(File inputFile)
          Extract metadata from the given file
 FfmpegInfo getInfo(File inputFile)
          Extract and process metadata from the given file
 void setEnvironmentVariable(String key, String value)
          Set an environment variable to be made available to the executing FFmpeg
 String testAvailability()
          What level of functionality is available from FFmpeg on this system
 String transform(List<String> params, File location)
          Transform a file using the provided parameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FfmpegImpl

public FfmpegImpl()
Instantiate using default binaries


FfmpegImpl

public FfmpegImpl(String executable,
                  String metadata)
Instantiate using provided binaries (if found)

Parameters:
executable - Binary for transcoding
metadata - Binary for metadata extraction
Method Detail

testAvailability

public String testAvailability()
What level of functionality is available from FFmpeg on this system

Specified by:
testAvailability in interface Ffmpeg
Returns:
String indicating the level of available functionality

extract

public String extract(File inputFile)
               throws IOException
Extract metadata from the given file

Specified by:
extract in interface Ffmpeg
Parameters:
file - to extract metadata from
Returns:
String containing the raw output
Throws:
IOException - if execution failed

transform

public String transform(List<String> params,
                        File location)
                 throws IOException
Transform a file using the provided parameters

Specified by:
transform in interface Ffmpeg
Parameters:
params - List of parameters to provide the binary
location - A File object of the working directory to use during transcoding
Returns:
String containing the raw output
Throws:
IOException - if execution failed

getInfo

public FfmpegInfo getInfo(File inputFile)
                   throws IOException
Extract and process metadata from the given file

Specified by:
getInfo in interface Ffmpeg
Parameters:
file - to extract metadata from
Returns:
FfmpegInfo containing the processed output
Throws:
IOException - if execution failed

setEnvironmentVariable

public void setEnvironmentVariable(String key,
                                   String value)
Set an environment variable to be made available to the executing FFmpeg

Specified by:
setEnvironmentVariable in interface Ffmpeg
Parameters:
key - : The name of environment variable
value - : The value to assign


Copyright © 2009-2014. All Rights Reserved.