FragmentedMp4Muxer.Builder
public final class FragmentedMp4Muxer.Builder
A builder for FragmentedMp4Muxer instances.
Summary
Public constructors |
|---|
Builder(WritableByteChannel outputChannel)Creates a |
@InlineMe(replacement = "this(Channels.newChannel(outputStream))", imports = "java.nio.channels.Channels")This method is deprecated. Use |
Public methods |
|
|---|---|
FragmentedMp4Muxer |
build()Builds a |
FragmentedMp4Muxer.Builder |
@CanIgnoreReturnValueSets the fragment duration (in milliseconds). |
FragmentedMp4Muxer.Builder |
@CanIgnoreReturnValueSets whether to enable the sample copy. |
Public constructors
Builder
public Builder(WritableByteChannel outputChannel)
Creates a Builder instance with default values.
| Parameters | |
|---|---|
WritableByteChannel outputChannel |
The |
Builder
@InlineMe(replacement = "this(Channels.newChannel(outputStream))", imports = "java.nio.channels.Channels")
publicBuilder(OutputStream outputStream)
Public methods
setFragmentDurationMs
@CanIgnoreReturnValue
public FragmentedMp4Muxer.Builder setFragmentDurationMs(long fragmentDurationMs)
Sets the fragment duration (in milliseconds).
The muxer will attempt to create fragments of the given duration but the actual duration might be greater depending upon the frequency of sync samples.
The default value is DEFAULT_FRAGMENT_DURATION_MS.
setSampleCopyingEnabled
@CanIgnoreReturnValue
public FragmentedMp4Muxer.Builder setSampleCopyingEnabled(boolean enabled)
Sets whether to enable the sample copy.
If the sample copy is enabled, writeSampleData copies the input ByteBuffer and BufferInfo before it returns, so it is safe to reuse them immediately. Otherwise, the muxer takes ownership of the ByteBuffer and the BufferInfo and the caller must not modify them.
The default value is true.