Search in sources :

Example 1 with IMOperation

use of org.fagu.fmv.im.IMOperation in project fmv by f-agu.

the class IMReducer method reduceMedia.

/**
 * @see org.fagu.fmv.mymedia.reduce.Reducer#reduceMedia(java.io.File, String, Logger)
 */
@Override
public Reduced reduceMedia(File srcFile, String consolePrefixMessage, Logger logger) throws IOException {
    File destFile = getTempFile(srcFile, format);
    IMOperation op = new IMOperation();
    op.image(srcFile, "[0]").autoOrient().quality(quality).image(destFile);
    Soft convertSoft = Convert.search();
    convertSoft.withParameters(op.toList()).logCommandLine(line -> logger.log("Exec: " + line)).execute();
    return new Reduced(destFile, false);
}
Also used : Soft(org.fagu.fmv.soft.Soft) Convert(org.fagu.fmv.im.soft.Convert) IMOperation(org.fagu.fmv.im.IMOperation) Logger(org.fagu.fmv.mymedia.logger.Logger) IOException(java.io.IOException) FileUtils(org.apache.commons.io.FileUtils) File(java.io.File) Loggers(org.fagu.fmv.mymedia.logger.Loggers) IMOperation(org.fagu.fmv.im.IMOperation) File(java.io.File) Soft(org.fagu.fmv.soft.Soft)

Aggregations

File (java.io.File)1 IOException (java.io.IOException)1 FileUtils (org.apache.commons.io.FileUtils)1 IMOperation (org.fagu.fmv.im.IMOperation)1 Convert (org.fagu.fmv.im.soft.Convert)1 Logger (org.fagu.fmv.mymedia.logger.Logger)1 Loggers (org.fagu.fmv.mymedia.logger.Loggers)1 Soft (org.fagu.fmv.soft.Soft)1