Class SyncSampleIntersectFinderImpl

  • All Implemented Interfaces:
    Fragmenter

    public class SyncSampleIntersectFinderImpl
    extends Object
    implements Fragmenter
    This FragmentIntersectionFinder cuts the input movie video tracks in fragments of the same length exactly before the sync samples. Audio tracks are cut into pieces of similar length.
    • Constructor Detail

      • SyncSampleIntersectFinderImpl

        public SyncSampleIntersectFinderImpl​(Movie movie,
                                             Track referenceTrack,
                                             int minFragmentDurationSeconds)
        Creates a SyncSampleIntersectFinderImpl that will not create any fragment smaller than the given minFragmentDurationSeconds
        Parameters:
        movie - this movie is the reference
        referenceTrack - used for audio tracks to find similar boundaries of segments.
        minFragmentDurationSeconds - the smallest allowable duration of a fragment.
    • Method Detail

      • getSyncSamplesTimestamps

        public static List<long[]> getSyncSamplesTimestamps​(Movie movie,
                                                            Track track)
        Calculates the timestamp of all tracks' sync samples.
        Parameters:
        movie - track is located in this movie
        track - get this track's samples timestamps
        Returns:
        a list of timestamps
      • sampleNumbers

        public long[] sampleNumbers​(Track track)
        Gets an array of sample numbers that are meant to be the first sample of each chunk or fragment.
        Specified by:
        sampleNumbers in interface Fragmenter
        Parameters:
        track - concerned track
        Returns:
        an array containing the ordinal of each fragment's first sample
      • getCommonIndices

        public long[] getCommonIndices​(long[] syncSamples,
                                       long[] syncSampleTimes,
                                       long timeScale,
                                       long[]... otherTracksTimes)