Package ws.schild.jave
Class MultimediaObject
java.lang.Object
ws.schild.jave.MultimediaObject
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final PatternThis regexp is used to parse the ffmpeg output about the bit depth of an audio stream.private static final PatternThis regexp is used to parse the ffmpeg output about the bit rate value of a stream.private static final PatternThis regexp is used to parse the ffmpeg output about the channels number of an audio stream.private static final PatternThis regexp is used to parse the ffmpeg output about the frame rate value of a video stream.private Fileprivate URLprivate final ProcessLocatorThe locator of the ffmpeg executable used by this extractor.private static final org.slf4j.Loggerprivate booleanWhen true, we try to not read the source more than once.private static final PatternThis regexp is used to parse the ffmpeg output about the sampling rate of an audio stream.private static final PatternThis regexp is used to parse the ffmpeg output about the size of a video stream. -
Constructor Summary
ConstructorsConstructorDescriptionMultimediaObject(File input) It builds an extractor using aDefaultFFMPEGLocatorinstance to locate the ffmpeg executable to use.MultimediaObject(File input, ProcessLocator locator) It builds an extractor with a customFFMPEGProcess.MultimediaObject(URL input) It builds an extractor using aDefaultFFMPEGLocatorinstance to locate the ffmpeg executable to use.MultimediaObject(URL input, boolean readURLOnce) It builds an extractor using aDefaultFFMPEGLocatorinstance to locate the ffmpeg executable to use. -
Method Summary
Modifier and TypeMethodDescriptiongetFile()getInfo()Returns a set informations about a multimedia file, if its format is supported for decoding.getURL()booleanbooleanisURL()Check if we have a file or an URLprivate MultimediaInfoparseMultimediaInfo(String source, RBufferedReader reader) Private utility.voidvoidsetReadURLOnce(boolean readURLOnce) voidtoString()
-
Field Details
-
LOG
private static final org.slf4j.Logger LOG -
SIZE_PATTERN
This regexp is used to parse the ffmpeg output about the size of a video stream. -
FRAME_RATE_PATTERN
This regexp is used to parse the ffmpeg output about the frame rate value of a video stream. -
BIT_RATE_PATTERN
This regexp is used to parse the ffmpeg output about the bit rate value of a stream. -
SAMPLING_RATE_PATTERN
This regexp is used to parse the ffmpeg output about the sampling rate of an audio stream. -
CHANNELS_PATTERN
This regexp is used to parse the ffmpeg output about the channels number of an audio stream. -
BIT_DEPTH_PATTERN
This regexp is used to parse the ffmpeg output about the bit depth of an audio stream. -
locator
The locator of the ffmpeg executable used by this extractor. -
inputFile
-
inputURL
-
readURLOnce
private boolean readURLOnceWhen true, we try to not read the source more than once. One of the side effects is, that no progressbar is available
-
-
Constructor Details
-
MultimediaObject
It builds an extractor using aDefaultFFMPEGLocatorinstance to locate the ffmpeg executable to use.- Parameters:
input- Input file for creating MultimediaObject
-
MultimediaObject
It builds an extractor using aDefaultFFMPEGLocatorinstance to locate the ffmpeg executable to use.- Parameters:
input- Input URL for creating MultimediaObject
-
MultimediaObject
It builds an extractor using aDefaultFFMPEGLocatorinstance to locate the ffmpeg executable to use.- Parameters:
input- Input URL for creating MultimediaObjectreadURLOnce- When true, we try to not read the source more than once One of the side effects is, that no progressbar is available.
-
MultimediaObject
It builds an extractor with a customFFMPEGProcess.- Parameters:
input- Input file for creating MultimediaObjectlocator- The locator picking up the ffmpeg executable used by the extractor.
-
-
Method Details
-
setReadURLOnce
public void setReadURLOnce(boolean readURLOnce) - Parameters:
readURLOnce- the readURLOnce to set
-
getFile
- Returns:
- file
-
getURL
-
setFile
-
setURL
-
isURL
public boolean isURL()Check if we have a file or an URL- Returns:
- true if this object references an URL
-
getInfo
Returns a set informations about a multimedia file, if its format is supported for decoding.- Returns:
- A set of informations about the file and its contents.
- Throws:
InputFormatException- If the format of the source file cannot be recognized and decoded.EncoderException- If a problem occurs calling the underlying ffmpeg executable.
-
parseMultimediaInfo
private MultimediaInfo parseMultimediaInfo(String source, RBufferedReader reader) throws InputFormatException, EncoderException Private utility. It parses the ffmpeg output, extracting informations about a source multimedia file.- Parameters:
source- The source multimedia object.reader- The ffmpeg output channel.- Returns:
- A set of informations about the source multimedia file and its contents.
- Throws:
InputFormatException- If the format of the source file cannot be recognized and decoded.EncoderException- If a problem occurs calling the underlying ffmpeg executable.
-
isReadURLOnce
public boolean isReadURLOnce()- Returns:
- the readURLOnce
-
toString
-