Package org.mp4parser.muxer.builder
Class SyncSampleIntersectFinderImpl
- java.lang.Object
-
- org.mp4parser.muxer.builder.SyncSampleIntersectFinderImpl
-
- All Implemented Interfaces:
Fragmenter
public class SyncSampleIntersectFinderImpl extends Object implements Fragmenter
ThisFragmentIntersectionFindercuts 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 Summary
Constructors Constructor Description SyncSampleIntersectFinderImpl(Movie movie, Track referenceTrack, int minFragmentDurationSeconds)Creates aSyncSampleIntersectFinderImplthat will not create any fragment smaller than the givenminFragmentDurationSeconds
-
Method Summary
Modifier and Type Method Description long[]getCommonIndices(long[] syncSamples, long[] syncSampleTimes, long timeScale, long[]... otherTracksTimes)static List<long[]>getSyncSamplesTimestamps(Movie movie, Track track)Calculates the timestamp of all tracks' sync samples.long[]sampleNumbers(Track track)Gets an array of sample numbers that are meant to be the first sample of each chunk or fragment.
-
-
-
Constructor Detail
-
SyncSampleIntersectFinderImpl
public SyncSampleIntersectFinderImpl(Movie movie, Track referenceTrack, int minFragmentDurationSeconds)
Creates aSyncSampleIntersectFinderImplthat will not create any fragment smaller than the givenminFragmentDurationSeconds- Parameters:
movie- this movie is the referencereferenceTrack- 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-trackis located in this movietrack- 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:
sampleNumbersin interfaceFragmenter- 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)
-
-