WebmMuxer
@UnstableApi
class WebmMuxer : Muxer
A muxer for creating a WebM container file.
Muxer supports muxing of:
- Video Codecs:
- VP8
- VP9
- Audio Codecs:
- Opus
- Vorbis
Summary
Nested types |
|---|
class WebmMuxer.BuilderA builder for |
Public functions |
|
|---|---|
Unit |
addMetadataEntry(metadataEntry: Metadata.Entry!)Adds |
Int |
Adds a track of the given media format. |
Unit |
close()Closes the file. |
Unit |
writeSampleData(Writes encoded sample data. |
Public functions
addMetadataEntry
fun addMetadataEntry(metadataEntry: Metadata.Entry!): Unit
Adds metadata about the output file.
addTrack
fun addTrack(format: Format!): Int
Adds a track of the given media format.
All tracks must be added before any samples are written to any track.
| Returns | |
|---|---|
Int |
A track id for this track, which should be passed to |
| Throws | |
|---|---|
androidx.media3.muxer.MuxerException |
If the muxer encounters a problem while adding the track. |
close
fun close(): Unit
Closes the file.
The muxer cannot be used anymore once this method returns.
| Throws | |
|---|---|
androidx.media3.muxer.MuxerException |
If the muxer fails to finish writing the output. |
writeSampleData
fun writeSampleData(
trackId: Int,
byteBuffer: ByteBuffer!,
bufferInfo: BufferInfo!
): Unit
Writes encoded sample data.
| Parameters | |
|---|---|
trackId: Int |
The track id for which this sample is being written. |
byteBuffer: ByteBuffer! |
The encoded sample. The muxer takes ownership of the buffer if |
bufferInfo: BufferInfo! |
The |
| Throws | |
|---|---|
androidx.media3.muxer.MuxerException |
If an error occurs while writing data to the output file. |