Package org.mp4parser.muxer.tracks.h264
Class H264TrackImpl
- java.lang.Object
-
- org.mp4parser.muxer.AbstractTrack
-
- org.mp4parser.muxer.tracks.AbstractH26XTrack
-
- org.mp4parser.muxer.tracks.h264.H264TrackImpl
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Track
public class H264TrackImpl extends AbstractH26XTrack
TheH264TrackImplcreates aTrackfrom an H.264 Annex B file.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classH264TrackImpl.ByteBufferBackedInputStream-
Nested classes/interfaces inherited from class org.mp4parser.muxer.tracks.AbstractH26XTrack
AbstractH26XTrack.LookAhead
-
-
Field Summary
-
Fields inherited from class org.mp4parser.muxer.tracks.AbstractH26XTrack
BUFFER, ctts, decodingTimes, sdtp, stss, trackMetaData
-
-
Constructor Summary
Constructors Constructor Description H264TrackImpl(DataSource dataSource)H264TrackImpl(DataSource dataSource, String lang)H264TrackImpl(DataSource dataSource, String lang, long timescale, int frametick)Creates a newTrackobject from a raw H264 source (DataSource dataSource1).
-
Method Summary
Modifier and Type Method Description voidcalcCtts()protected SampleEntrygetCurrentSampleEntry()StringgetHandler()static H264NalUnitHeadergetNalUnitHeader(ByteBuffer nal)List<SampleEntry>getSampleEntries()List<Sample>getSamples()The list of all samples.static voidmain(String[] args)-
Methods inherited from class org.mp4parser.muxer.tracks.AbstractH26XTrack
cleanBuffer, close, createSampleObject, findNextNal, getCompositionTimeEntries, getSampleDependencies, getSampleDurations, getSyncSamples, getTrackMetaData, toArray
-
Methods inherited from class org.mp4parser.muxer.AbstractTrack
getDuration, getEdits, getName, getSampleGroups, getSubsampleInformationBox
-
-
-
-
Constructor Detail
-
H264TrackImpl
public H264TrackImpl(DataSource dataSource, String lang, long timescale, int frametick) throws IOException
Creates a newTrackobject from a raw H264 source (DataSource dataSource1). Whenever the timescale and frametick are set to negative value (e.g. -1) the H264TrackImpl tries to detect the frame rate. Typically values fortimescaleandframetickare:- 23.976 FPS: timescale = 24000; frametick = 1001
- 25 FPS: timescale = 25; frametick = 1
- 29.97 FPS: timescale = 30000; frametick = 1001
- 30 FPS: timescale = 30; frametick = 1
- Parameters:
dataSource- the source file of the H264 sampleslang- language of the movie (in doubt: use "eng")timescale- number of time units (ticks) in one secondframetick- number of time units (ticks) that pass while showing exactly one frame- Throws:
IOException- in case of problems whiel reading from theDataSource
-
H264TrackImpl
public H264TrackImpl(DataSource dataSource, String lang) throws IOException
- Throws:
IOException
-
H264TrackImpl
public H264TrackImpl(DataSource dataSource) throws IOException
- Throws:
IOException
-
-
Method Detail
-
getCurrentSampleEntry
protected SampleEntry getCurrentSampleEntry()
- Specified by:
getCurrentSampleEntryin classAbstractH26XTrack
-
main
public static void main(String[] args) throws IOException
- Throws:
IOException
-
getNalUnitHeader
public static H264NalUnitHeader getNalUnitHeader(ByteBuffer nal)
-
getSampleEntries
public List<SampleEntry> getSampleEntries()
-
getHandler
public String getHandler()
-
getSamples
public List<Sample> getSamples()
Description copied from interface:TrackThe list of all samples.- Returns:
- this track's samples
-
calcCtts
public void calcCtts()
-
-