FFmpegError

sealed class FFmpegError

Every KiteFFmpeg failure surfaces as FFmpegException wrapping a typed FFmpegError.

The hierarchy maps the raw AVERROR_* codes onto semantic categories so callers can react without decoding negative errno math:

try { Transcoder.transcode(...) } catch (e: FFmpegException) {
when (e.error) {
is FFmpegError.FileNotFound -> promptForFile()
is FFmpegError.EncoderNotFound -> fallBackToSoftwareEncoder()
is FFmpegError.InvalidData -> reportCorruptInput()
else -> log(e.error.code, e.message)
}
}

Every subclass keeps the raw code in code (0 for Internal), so nothing is lost by the classification; unmapped codes surface as AvError.

Inheritors

Types

Link copied to clipboard
class AvError(code: Int, message: String) : FFmpegError

Any AVERROR_* code without a dedicated category above.

Link copied to clipboard
object Companion
Link copied to clipboard
class DecoderNotFound(code: Int, message: String) : FFmpegError

The bound FFmpeg build has no such decoder (AVERROR_DECODER_NOT_FOUND).

Link copied to clipboard
class DemuxerNotFound(code: Int, message: String) : FFmpegError

No demuxer recognizes the input (AVERROR_DEMUXER_NOT_FOUND).

Link copied to clipboard
class EncoderNotFound(code: Int, message: String) : FFmpegError

The bound FFmpeg build has no such encoder (AVERROR_ENCODER_NOT_FOUND).

Link copied to clipboard
class EndOfFile(code: Int, message: String) : FFmpegError

End of file/stream surfaced as an error (AVERROR_EOF). Rare, loops consume it.

Link copied to clipboard
class FileNotFound(code: Int, message: String) : FFmpegError

Input path does not exist (AVERROR(ENOENT)).

Link copied to clipboard
class FilterNotFound(code: Int, message: String) : FFmpegError

The bound FFmpeg build has no such filter (AVERROR_FILTER_NOT_FOUND).

Link copied to clipboard

The linked FFmpeg runtime does not match the headers KiteFFmpeg's C layer was compiled against, so KiteFFmpeg refused to use it.

Link copied to clipboard
class Internal(message: String) : FFmpegError

Library-internal invariant failure, not an FFmpeg return code.

Link copied to clipboard
class Interrupted(code: Int, message: String) : FFmpegError

The call was interrupted through MediaSource.interrupt (AVERROR_EXIT).

Link copied to clipboard
class InvalidArgument(code: Int, message: String) : FFmpegError

Invalid parameter combination rejected by FFmpeg (AVERROR(EINVAL)).

Link copied to clipboard
class InvalidData(code: Int, message: String) : FFmpegError

Corrupt or unrecognized bitstream/container data (AVERROR_INVALIDDATA).

Link copied to clipboard
class Io(code: Int, message: String) : FFmpegError

Generic I/O failure (AVERROR(EIO)).

Link copied to clipboard
class MuxerNotFound(code: Int, message: String) : FFmpegError

No muxer for the requested output format (AVERROR_MUXER_NOT_FOUND).

Link copied to clipboard
class OptionNotFound(code: Int, message: String) : FFmpegError

Unknown codec/format private option (AVERROR_OPTION_NOT_FOUND).

Link copied to clipboard
class OutOfMemory(code: Int, message: String) : FFmpegError

Native allocation failure (AVERROR(ENOMEM)).

Link copied to clipboard
class PermissionDenied(code: Int, message: String) : FFmpegError

Filesystem permission denied (AVERROR(EACCES) / AVERROR(EPERM)).

Link copied to clipboard
class ProtocolNotFound(code: Int, message: String) : FFmpegError

No protocol handler for the URL scheme (AVERROR_PROTOCOL_NOT_FOUND).

Link copied to clipboard
class StreamNotFound(code: Int, message: String) : FFmpegError

Requested stream does not exist (AVERROR_STREAM_NOT_FOUND).

Link copied to clipboard
class Unsupported(code: Int, message: String) : FFmpegError

Feature not implemented in FFmpeg (AVERROR_PATCHWELCOME).

Properties

Link copied to clipboard
val code: Int
Link copied to clipboard

Functions

Link copied to clipboard
open override fun toString(): String