Package org.mp4parser.muxer.tracks
Class ClippedTrack
- java.lang.Object
-
- org.mp4parser.muxer.AbstractTrack
-
- org.mp4parser.muxer.tracks.ClippedTrack
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Track
public class ClippedTrack extends AbstractTrack
Generates a Track that starts at fromSample and ends at toSample (exclusive). The user of this class has to make sure that the fromSample is a random access sample.- In AAC and most other audio formats this is every single sample
- In H264 this is every sample that is marked in the SyncSampleBox
-
-
Constructor Summary
Constructors Constructor Description ClippedTrack(Track origTrack, long fromSample, long toSample)Wraps an existing track and masks out a number of samples.
-
Method Summary
Modifier and Type Method Description voidclose()List<CompositionTimeToSample.Entry>getCompositionTimeEntries()StringgetHandler()List<SampleDependencyTypeBox.Entry>getSampleDependencies()long[]getSampleDurations()Each samples is covers a small time span in a video.List<SampleEntry>getSampleEntries()List<Sample>getSamples()The list of all samples.SubSampleInformationBoxgetSubsampleInformationBox()long[]getSyncSamples()TrackMetaDatagetTrackMetaData()-
Methods inherited from class org.mp4parser.muxer.AbstractTrack
getDuration, getEdits, getName, getSampleGroups
-
-
-
-
Constructor Detail
-
ClippedTrack
public ClippedTrack(Track origTrack, long fromSample, long toSample)
Wraps an existing track and masks out a number of samples. Works likeList.subList(int, int).- Parameters:
origTrack- the originalTrackfromSample- first sample in the newTrack- beginning with 0toSample- first sample not in the newTrack- beginning with 0
-
-
Method Detail
-
close
public void close() throws IOException- Throws:
IOException
-
getSamples
public List<Sample> getSamples()
Description copied from interface:TrackThe list of all samples.- Returns:
- this track's samples
-
getSampleEntries
public List<SampleEntry> getSampleEntries()
-
getSampleDurations
public long[] getSampleDurations()
Description copied from interface:TrackEach samples is covers a small time span in a video. This method returns the duration for each sample in track timescale. The array must contain exactly as many samples asTrack.getSamples()contains.- Returns:
- an array of ticks
-
getCompositionTimeEntries
public List<CompositionTimeToSample.Entry> getCompositionTimeEntries()
- Specified by:
getCompositionTimeEntriesin interfaceTrack- Overrides:
getCompositionTimeEntriesin classAbstractTrack
-
getSyncSamples
public long[] getSyncSamples()
- Specified by:
getSyncSamplesin interfaceTrack- Overrides:
getSyncSamplesin classAbstractTrack
-
getSampleDependencies
public List<SampleDependencyTypeBox.Entry> getSampleDependencies()
- Specified by:
getSampleDependenciesin interfaceTrack- Overrides:
getSampleDependenciesin classAbstractTrack
-
getTrackMetaData
public TrackMetaData getTrackMetaData()
-
getHandler
public String getHandler()
-
getSubsampleInformationBox
public SubSampleInformationBox getSubsampleInformationBox()
- Specified by:
getSubsampleInformationBoxin interfaceTrack- Overrides:
getSubsampleInformationBoxin classAbstractTrack
-
-