Class MultimediaObject


  • public class MultimediaObject
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.regex.Pattern BIT_DEPTH_PATTERN
      This regexp is used to parse the ffmpeg output about the bit depth of an audio stream.
      private static java.util.regex.Pattern BIT_RATE_PATTERN
      This regexp is used to parse the ffmpeg output about the bit rate value of a stream.
      private static java.util.regex.Pattern CHANNELS_PATTERN
      This regexp is used to parse the ffmpeg output about the channels number of an audio stream.
      private static java.util.regex.Pattern FRAME_RATE_PATTERN
      This regexp is used to parse the ffmpeg output about the frame rate value of a video stream.
      private java.io.File inputFile  
      private java.net.URL inputURL  
      private ProcessLocator locator
      The locator of the ffmpeg executable used by this extractor.
      private static org.slf4j.Logger LOG  
      private boolean readURLOnce
      When true, we try to not read the source more than once.
      private static java.util.regex.Pattern SAMPLING_RATE_PATTERN
      This regexp is used to parse the ffmpeg output about the sampling rate of an audio stream.
      private static java.util.regex.Pattern SIZE_PATTERN
      This regexp is used to parse the ffmpeg output about the size of a video stream.
    • Field Detail

      • LOG

        private static final org.slf4j.Logger LOG
      • SIZE_PATTERN

        private static final java.util.regex.Pattern SIZE_PATTERN
        This regexp is used to parse the ffmpeg output about the size of a video stream.
      • FRAME_RATE_PATTERN

        private static final java.util.regex.Pattern FRAME_RATE_PATTERN
        This regexp is used to parse the ffmpeg output about the frame rate value of a video stream.
      • BIT_RATE_PATTERN

        private static final java.util.regex.Pattern BIT_RATE_PATTERN
        This regexp is used to parse the ffmpeg output about the bit rate value of a stream.
      • SAMPLING_RATE_PATTERN

        private static final java.util.regex.Pattern SAMPLING_RATE_PATTERN
        This regexp is used to parse the ffmpeg output about the sampling rate of an audio stream.
      • CHANNELS_PATTERN

        private static final java.util.regex.Pattern CHANNELS_PATTERN
        This regexp is used to parse the ffmpeg output about the channels number of an audio stream.
      • BIT_DEPTH_PATTERN

        private static final java.util.regex.Pattern BIT_DEPTH_PATTERN
        This regexp is used to parse the ffmpeg output about the bit depth of an audio stream.
      • locator

        private final ProcessLocator locator
        The locator of the ffmpeg executable used by this extractor.
      • inputFile

        private java.io.File inputFile
      • inputURL

        private java.net.URL inputURL
      • readURLOnce

        private boolean readURLOnce
        When true, we try to not read the source more than once. One of the side effects is, that no progressbar is available
    • Constructor Detail

      • MultimediaObject

        public MultimediaObject​(java.io.File input)
        It builds an extractor using a DefaultFFMPEGLocator instance to locate the ffmpeg executable to use.
        Parameters:
        input - Input file for creating MultimediaObject
      • MultimediaObject

        public MultimediaObject​(java.net.URL input)
        It builds an extractor using a DefaultFFMPEGLocator instance to locate the ffmpeg executable to use.
        Parameters:
        input - Input URL for creating MultimediaObject
      • MultimediaObject

        public MultimediaObject​(java.net.URL input,
                                boolean readURLOnce)
        It builds an extractor using a DefaultFFMPEGLocator instance to locate the ffmpeg executable to use.
        Parameters:
        input - Input URL for creating MultimediaObject
        readURLOnce - When true, we try to not read the source more than once One of the side effects is, that no progressbar is available.
      • MultimediaObject

        public MultimediaObject​(java.io.File input,
                                ProcessLocator locator)
        It builds an extractor with a custom FFMPEGProcess.
        Parameters:
        input - Input file for creating MultimediaObject
        locator - The locator picking up the ffmpeg executable used by the extractor.
    • Method Detail

      • setReadURLOnce

        public void setReadURLOnce​(boolean readURLOnce)
        Parameters:
        readURLOnce - the readURLOnce to set
      • getFile

        public java.io.File getFile()
        Returns:
        file
      • getURL

        public java.net.URL getURL()
      • setFile

        public void setFile​(java.io.File file)
      • setURL

        public void setURL​(java.net.URL input)
      • isURL

        public boolean isURL()
        Check if we have a file or an URL
        Returns:
        true if this object references an URL
      • parseMultimediaInfo

        private MultimediaInfo parseMultimediaInfo​(java.lang.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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object