addCopyStream

expect fun addCopyStream(source: MediaSource, stream: StreamInfo): CopyStream

Add an output stream that copies stream's packets verbatim from source: no decode, no re-encode, only timestamp rescaling into the output's time-base (ffmpeg -c copy). A format pair that needs a bitstream filter, such as H.264 in MP4 to MPEG-TS, gets it automatically when the packets are written.

Must be called before any frame/packet is written. Packets are pulled by Remuxer or Transcoder; this only declares the mapping.

Throws

with FFmpegError.InvalidArgument when this sink writes the file source was opened from, through any link or spelling of its path, because writing the header would truncate the media being copied. Nothing is added and the file is not touched, so the sink stays usable.

actual fun addCopyStream(source: MediaSource, stream: StreamInfo): CopyStream

Add an output stream that copies stream's packets verbatim from source: no decode, no re-encode, only timestamp rescaling into the output's time-base (ffmpeg -c copy). A format pair that needs a bitstream filter, such as H.264 in MP4 to MPEG-TS, gets it automatically when the packets are written.

Must be called before any frame/packet is written. Packets are pulled by Remuxer or Transcoder; this only declares the mapping.

Throws

with FFmpegError.InvalidArgument when this sink writes the file source was opened from, through any link or spelling of its path, because writing the header would truncate the media being copied. Nothing is added and the file is not touched, so the sink stays usable.

actual fun addCopyStream(source: MediaSource, stream: StreamInfo): CopyStream

Add an output stream that copies stream's packets verbatim from source: no decode, no re-encode, only timestamp rescaling into the output's time-base (ffmpeg -c copy). A format pair that needs a bitstream filter, such as H.264 in MP4 to MPEG-TS, gets it automatically when the packets are written.

Must be called before any frame/packet is written. Packets are pulled by Remuxer or Transcoder; this only declares the mapping.

Throws

with FFmpegError.InvalidArgument when this sink writes the file source was opened from, through any link or spelling of its path, because writing the header would truncate the media being copied. Nothing is added and the file is not touched, so the sink stays usable.

actual fun addCopyStream(source: MediaSource, stream: StreamInfo): CopyStream

Add an output stream that copies stream's packets verbatim from source: no decode, no re-encode, only timestamp rescaling into the output's time-base (ffmpeg -c copy). A format pair that needs a bitstream filter, such as H.264 in MP4 to MPEG-TS, gets it automatically when the packets are written.

Must be called before any frame/packet is written. Packets are pulled by Remuxer or Transcoder; this only declares the mapping.

Throws

with FFmpegError.InvalidArgument when this sink writes the file source was opened from, through any link or spelling of its path, because writing the header would truncate the media being copied. Nothing is added and the file is not touched, so the sink stays usable.