public interface MovieWriter extends Multiplexer
Modifier and Type | Method and Description |
---|---|
int |
addTrack(Format format)
Adds a track to the writer for a suggested input format.
|
void |
close()
Closes the writer.
|
Rational |
getDuration(int track)
Returns the duration of the track in seconds.
|
Format |
getFileFormat()
Returns the file format.
|
Format |
getFormat(int track)
Returns the media format of the specified track.
|
int |
getTrackCount()
Returns the number of tracks.
|
boolean |
isDataLimitReached()
Returns true if the limit for media data has been reached.
|
boolean |
isEmpty(int track)
Returns true if the specified track has no samples.
|
void |
write(int track,
Buffer buf)
Writes a sample into the specified track.
|
Format getFileFormat() throws java.io.IOException
java.io.IOException
int addTrack(Format format) throws java.io.IOException
The format should at least specify the desired FormatKeys.MediaType
.
The actual input format is a refined version of the suggested format. For
example, if a MovieWriter only supports fixed frame rate video, then the
MovieWriter will extend the format with that information.
If the suggested input format is not compatible, then an IOException is thrown. For example, if a MovieWriter only supports fixed frame rate video, but a format with variable frame rate was requested.
format
- The desired input format of the track. The actual input
format may be a refined version of the specified format.java.io.IOException
Format getFormat(int track)
addTrack(org.monte.media.Format)
.track
- Track number.int getTrackCount()
void write(int track, Buffer buf) throws java.io.IOException
write
in interface Multiplexer
track
- The track number.buf
- The buffer containing the sample data.java.io.IOException
void close() throws java.io.IOException
close
in interface Multiplexer
java.io.IOException
boolean isDataLimitReached()
This limit is imposed by data structures of the movie file which will overflow if more samples are added to the movie.
FIXME - Maybe replace by getCapacity():long.
Rational getDuration(int track)
boolean isEmpty(int track)