Package ws.schild.jave
Class ScreenExtractor
- java.lang.Object
-
- ws.schild.jave.ScreenExtractor
-
public class ScreenExtractor extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ScreenExtractor()It builds an extractor using aDefaultFFMPEGLocatorinstance to locate the ffmpeg executable to use.ScreenExtractor(FFMPEGLocator locator)It builds an extractor with a customFFMPEGLocator.
-
Method Summary
Modifier and Type Method Description intgetNumberOfScreens()voidrender(MultimediaObject multimediaObject, int width, int height, int seconds, java.io.File target, int quality)Generate a single screenshot from source video.voidrender(MultimediaObject multimediaObject, int width, int height, int seconds, java.io.File outputDir, java.lang.String fileNamePrefix, java.lang.String extension, int quality)Generates screenshots from source video.
-
-
-
Constructor Detail
-
ScreenExtractor
public ScreenExtractor()
It builds an extractor using aDefaultFFMPEGLocatorinstance to locate the ffmpeg executable to use.
-
ScreenExtractor
public ScreenExtractor(FFMPEGLocator locator)
It builds an extractor with a customFFMPEGLocator.- Parameters:
locator- The locator picking up the ffmpeg executable used by the extractor.
-
-
Method Detail
-
getNumberOfScreens
public int getNumberOfScreens()
- Returns:
- The number of screens found
-
render
public void render(MultimediaObject multimediaObject, int width, int height, int seconds, java.io.File outputDir, java.lang.String fileNamePrefix, java.lang.String extension, int quality) throws InputFormatException, EncoderException
Generates screenshots from source video.- Parameters:
multimediaObject- Source MultimediaObject @see MultimediaObjectwidth- Output widthheight- Output heightseconds- 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 quality- Throws:
InputFormatException- If the source multimedia file cannot be decoded.EncoderException- If a problems occurs during the encoding process.
-
render
public void render(MultimediaObject multimediaObject, int width, int height, int seconds, java.io.File target, int quality) throws EncoderException
Generate a single screenshot from source video.- Parameters:
multimediaObject- Source MultimediaObject @see MultimediaObjectwidth- Output widthheight- Output heightseconds- Interval in seconds between screenstarget- Destination of output imagequality- The range is between 1-31 with 31 being the worst quality- Throws:
InputFormatException- If the source multimedia file cannot be decoded.EncoderException- If a problems occurs during the encoding process.
-
-