Class Track

  • public final class Track
    extends Object
    Encapsulates information describing an MP4 track.
    • Field Detail


        public static final int TRANSFORMATION_NONE
        A no-op sample transformation.
        See Also:
        Constant Field Values

        public static final int TRANSFORMATION_CEA608_CDAT
        A transformation for caption samples in cdat atoms.
        See Also:
        Constant Field Values
      • id

        public final int id
        The track identifier.
      • timescale

        public final long timescale
        The track timescale, defined as the number of time units that pass in one second.
      • movieTimescale

        public final long movieTimescale
        The movie timescale.
      • durationUs

        public final long durationUs
        The duration of the track in microseconds, or C.TIME_UNSET if unknown.
      • format

        public final Format format
        The format.
      • sampleTransformation

        public final int sampleTransformation
        One of TRANSFORMATION_*. Defines the transformation to apply before outputting each sample.
      • editListDurations

        public final long[] editListDurations
        Durations of edit list segments in the movie timescale. Null if there is no edit list.
      • editListMediaTimes

        public final long[] editListMediaTimes
        Media times for edit list segments in the track timescale. Null if there is no edit list.
      • nalUnitLengthFieldLength

        public final int nalUnitLengthFieldLength
        For H264 video tracks, the length in bytes of the NALUnitLength field in each sample. 0 for other track types.
    • Constructor Detail

      • Track

        public Track​(int id,
                     int type,
                     long timescale,
                     long movieTimescale,
                     long durationUs,
                     Format format,
                     int sampleTransformation,
                     TrackEncryptionBox[] sampleDescriptionEncryptionBoxes,
                     int nalUnitLengthFieldLength,
                     long[] editListDurations,
                     long[] editListMediaTimes)
    • Method Detail

      • getSampleDescriptionEncryptionBox

        public TrackEncryptionBox getSampleDescriptionEncryptionBox​(int sampleDescriptionIndex)
        Returns the TrackEncryptionBox for the given sample description index.
        sampleDescriptionIndex - The given sample description index
        The TrackEncryptionBox for the given sample description index. Maybe null if no such entry exists.
      • copyWithFormat

        public Track copyWithFormat​(Format format)