use of org.fagu.fmv.ffmpeg.executor.FFMPEGExecutorBuilder in project fmv by f-agu.
the class FFHelper method autoRotate.
/**
* @param inFile
* @param outFile
* @param size
* @throws IOException
*/
public static void autoRotate(File inFile, File outFile) throws IOException {
FFMPEGExecutorBuilder builder = FFMPEGExecutorBuilder.create();
InputProcessor inputProcessor = builder.addMediaInputFile(inFile);
builder.filter(AutoRotate.create(inputProcessor.getMovieMetadatas()));
builder.addMediaOutputFile(outFile).overwrite();
FFExecutor<Object> executor = builder.build();
executor.execute();
}
use of org.fagu.fmv.ffmpeg.executor.FFMPEGExecutorBuilder in project fmv by f-agu.
the class FFHelper method extractOneThumbnail.
/**
* @param inFile
* @param outImageFile
* @param time
* @return
* @throws IOException
*/
public static void extractOneThumbnail(File inFile, File outImageFile, Time time) throws IOException {
FFMPEGExecutorBuilder builder = FFMPEGExecutorBuilder.create();
builder.addMediaInputFile(inFile);
builder.mux(Image2Muxer.to(outImageFile)).timeSeek(time).numberOfVideoFrameToRecord(// only one thumbnail
1).overwrite();
FFExecutor<Object> executor = builder.build();
executor.execute();
}
use of org.fagu.fmv.ffmpeg.executor.FFMPEGExecutorBuilder in project fmv by f-agu.
the class FFHelper method cropDetect.
/**
* @param inFile
* @throws IOException
*/
public static CropDetection cropDetect(File inFile) throws IOException {
FFMPEGExecutorBuilder builder = FFMPEGExecutorBuilder.create();
builder.addMediaInputFile(inFile).timeSeek(Time.parse("36:05")).duration(Duration.valueOf(3));
CropDetect cropDetect = CropDetect.build();
builder.filter(cropDetect);
builder.addMediaOutput(NullMuxer.build()).overwrite();
FFExecutor<Object> executor = builder.build();
System.out.println(executor.getCommandLine());
executor.execute();
return cropDetect.getCropSizeDetected();
}
use of org.fagu.fmv.ffmpeg.executor.FFMPEGExecutorBuilder in project fmv by f-agu.
the class FFHelper method fade2.
/**
* @param inFile
* @param outFile
* @param fadeType
* @param duration
* @throws IOException
*/
public static void fade2(File inFile, File outFile, FadeType fadeType, Duration duration) throws IOException {
FFMPEGExecutorBuilder builder = FFMPEGExecutorBuilder.create();
InputProcessor inputProcessor = builder.addMediaInputFile(inFile);
Fade fade = Fade.create(fadeType, Time.valueOf(0), duration);
fade.addInput(inputProcessor);
builder.filter(fade);
builder.addMediaOutputFile(outFile).overwrite();
FFExecutor<Object> executor = builder.build();
executor.execute();
}
use of org.fagu.fmv.ffmpeg.executor.FFMPEGExecutorBuilder in project fmv by f-agu.
the class FFHelper method extractPart.
/**
* @param inFile
* @param outFolder
* @param startTime
* @param duration
* @throws IOException
*/
public static void extractPart(File inFile, File outFile, Time startTime, Duration duration) throws IOException {
FFMPEGExecutorBuilder builder = FFMPEGExecutorBuilder.create();
// input
builder.addMediaInputFile(inFile).timeSeek(startTime);
// ouput
builder.mux(MP4Muxer.to(outFile).avoidNegativeTs(AvoidNegativeTs.MAKE_NON_NEGATIVE)).duration(duration).qualityScale(0).codec(H264.findRecommanded().mostCompatible()).overwrite();
// execute
builder.build().execute();
}
Aggregations