public class ScreenExtractor extends Object
| Constructor and Description |
|---|
ScreenExtractor()
It builds an extractor using a
FFMPEGProcess instance to
locate the ffmpeg executable to use. |
ScreenExtractor(ProcessLocator locator)
It builds an extractor with a custom
FFMPEGProcess. |
| Modifier and Type | Method and Description |
|---|---|
int |
getNumberOfScreens() |
void |
render(MultimediaObject multimediaObject,
int width,
int height,
int seconds,
File outputDir,
int quality)
Generate a single screenshot from source video.
|
void |
render(MultimediaObject multimediaObject,
int width,
int height,
int seconds,
File outputDir,
String fileNamePrefix,
String extension,
int quality)
Generates screenshots from source video.
|
void |
renderOneImage(MultimediaObject multimediaObject,
int width,
int height,
long millis,
File outputFile,
int quality)
Generate exactly one screenshot from source video
|
void |
renderOneImage(MultimediaObject multimediaObject,
int width,
int height,
long millis,
File outputFile,
int quality,
boolean keyframesSeeking)
Generate exactly one screenshot from source video using given seeking mode.
|
public ScreenExtractor()
FFMPEGProcess instance to
locate the ffmpeg executable to use.public ScreenExtractor(ProcessLocator locator)
FFMPEGProcess.locator - The locator picking up the ffmpeg executable used by the extractor.public int getNumberOfScreens()
public void render(MultimediaObject multimediaObject, int width, int height, int seconds, File outputDir, String fileNamePrefix, String extension, int quality) throws InputFormatException, EncoderException
multimediaObject - Source MultimediaObject @see MultimediaObjectwidth - Output width, pass -1 to use video width and heightheight - Output height (Ignored when width = -1)seconds - Interval in seconds between screensoutputDir - Destination of output imagesfileNamePrefix - Name all thumbnails will start withextension - Image extension for output (jpg, png, etc)quality - The range is between 1-31 with 31 being the worst qualityInputFormatException - If the source multimedia file cannot be decoded.EncoderException - If a problems occurs during the encoding process.public void render(MultimediaObject multimediaObject, int width, int height, int seconds, File outputDir, int quality) throws EncoderException
multimediaObject - Source MultimediaObject @see MultimediaObjectwidth - Output width, pass -1 to use video width and heightheight - Output height (Ignored when width = -1)seconds - Interval in seconds between screensoutputDir - Destination folder of output imagequality - The range is between 1-31 with 31 being the worst qualityInputFormatException - If the source multimedia file cannot be decoded.EncoderException - If a problems occurs during the encoding process.public void renderOneImage(MultimediaObject multimediaObject, int width, int height, long millis, File outputFile, int quality) throws InputFormatException, EncoderException
multimediaObject - Source MultimediaObject @see MultimediaObjectwidth - Output width, pass -1 to use video width and heightheight - Output height (Ignored when width = -1)millis - At which second in the video should the screenshot be madeoutputFile - Outputfilequality - The range is between 1-31 with 31 being the worst qualityInputFormatException - If the source multimedia file cannot be decoded.EncoderException - If a problems occurs during the encoding process.public void renderOneImage(MultimediaObject multimediaObject, int width, int height, long millis, File outputFile, int quality, boolean keyframesSeeking) throws InputFormatException, EncoderException
multimediaObject - Source MultimediaObject @see MultimediaObjectwidth - Output width, pass -1 to use video width and heightheight - Output height (Ignored when width = -1)millis - At which second in the video should the screenshot be madeoutputFile - Outputfilequality - The range is between 1-31 with 31 being the worst qualitykeyframesSeeking - If True, it forces FFmpeg to parse an input file using keyframes, which
is very fast. If False, input will be parsed frame by frame. See FFmpeg Wiki: SeekingInputFormatException - If the source multimedia file cannot be decoded.EncoderException - If a problems occurs during the encoding process.Copyright © 2020. All rights reserved.