Class TimestampMovieSampler

  • All Implemented Interfaces:
    adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.SizeOfHandler, adams.core.Stoppable, Serializable

    public class TimestampMovieSampler
    extends AbstractBufferedImageMovieImageSampler
    Takes a list of timestamps in BaseTimeMSec format and returns an array containing the frames closest to those timestamps
    Version:
    $Revision$
    Author:
    steven
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected adams.data.image.BufferedImageContainer m_CurrentImage
      a container for storing the current image
      protected uk.co.caprica.vlcj.player.MediaPlayerFactory m_Factory
      a media player factory for getting the media player
      protected BufferedImage m_Image
      an image to feed the buffer into
      protected uk.co.caprica.vlcj.player.direct.DirectMediaPlayer m_MediaPlayer
      headless media player
      protected adams.data.image.BufferedImageContainer m_PreviousImage
      a container for storing the previous image
      protected List<adams.data.image.BufferedImageContainer> m_Samples
      the samples.
      protected long m_TargetTime  
      protected long m_TimeOffset  
      protected adams.core.base.BaseTimeMsec[] m_Timestamps
      the timestamps to grab.
      protected long[] m_TimeStampsLong
      List of time stamps to sample
      protected Dimension m_VideoDimension
      the dimensions of the video
      • Fields inherited from class adams.core.option.AbstractOptionHandler

        m_OptionManager
      • Fields inherited from class adams.core.logging.LoggingObject

        m_Logger, m_LoggingIsEnabled, m_LoggingLevel
    • Field Detail

      • m_TimeStampsLong

        protected long[] m_TimeStampsLong
        List of time stamps to sample
      • m_Timestamps

        protected adams.core.base.BaseTimeMsec[] m_Timestamps
        the timestamps to grab.
      • m_MediaPlayer

        protected uk.co.caprica.vlcj.player.direct.DirectMediaPlayer m_MediaPlayer
        headless media player
      • m_TargetTime

        protected long m_TargetTime
      • m_Samples

        protected List<adams.data.image.BufferedImageContainer> m_Samples
        the samples.
      • m_Factory

        protected uk.co.caprica.vlcj.player.MediaPlayerFactory m_Factory
        a media player factory for getting the media player
      • m_VideoDimension

        protected Dimension m_VideoDimension
        the dimensions of the video
      • m_Image

        protected BufferedImage m_Image
        an image to feed the buffer into
      • m_CurrentImage

        protected adams.data.image.BufferedImageContainer m_CurrentImage
        a container for storing the current image
      • m_PreviousImage

        protected adams.data.image.BufferedImageContainer m_PreviousImage
        a container for storing the previous image
      • m_TimeOffset

        protected long m_TimeOffset
    • Constructor Detail

      • TimestampMovieSampler

        public TimestampMovieSampler()
    • Method Detail

      • reset

        protected void reset()
        Overrides:
        reset in class adams.core.option.AbstractOptionHandler
      • setTimeStamps

        public void setTimeStamps​(adams.core.base.BaseTimeMsec[] timeStamps)
        Sets the timestamps to sample
        Parameters:
        timeStamps -
      • getTimeStamps

        public adams.core.base.BaseTimeMsec[] getTimeStamps()
        Returns the timestamps to sample.
        Returns:
        the timestamps
      • setTimeStampsAsLong

        public void setTimeStampsAsLong​(long[] timeStamps)
      • getTimeStampsAsLong

        public long[] getTimeStampsAsLong()
      • timeStampsTipText

        public String timeStampsTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • globalInfo

        public String globalInfo()
        Returns a string describing the object.
        Specified by:
        globalInfo in interface adams.core.GlobalInfoSupporter
        Specified by:
        globalInfo in class adams.core.option.AbstractOptionHandler
        Returns:
        a description suitable for displaying in the gui
      • defineOptions

        public void defineOptions()
        Adds options to the internal list of options.
        Specified by:
        defineOptions in interface adams.core.option.OptionHandler
        Overrides:
        defineOptions in class adams.core.option.AbstractOptionHandler
      • initialize

        protected void initialize()
        Initializes the members.
        Overrides:
        initialize in class adams.core.option.AbstractOptionHandler
      • doSample

        protected adams.data.image.BufferedImageContainer[] doSample​(File file)
        Samples images from a movie file. Code adapted from https://github.com/caprica/vlcj/blob/vlcj-3.0.1/src/test/java/uk/co/caprica/vlcj/test/condition/ConditionTest.java
        Specified by:
        doSample in class AbstractMovieImageSampler<adams.data.image.BufferedImageContainer>
        Parameters:
        file - the movie to sample
        Returns:
        the samples, null if failed to sample