Show / Hide Table of Contents

Class Logger

Provides access to the global FFmpeg logging system.

Inheritance
object
Logger
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: FFmpeg.Logging
Assembly: FFmpeg.dll
Syntax
public static class Logger
Remarks

FFmpeg logging is process-wide. Setting the log level, flags, or callback affects all FFmpeg components using the same native library instance.

Properties

View Source

IncludePrefix

Gets or sets whether FFmpeg log prefixes are included in messages.

Declaration
public static bool IncludePrefix { get; set; }
Property Value
Type Description
bool
Remarks

When enabled, messages may contain additional information such as the logging context name and other FFmpeg-generated prefixes.

View Source

Level

Gets or sets the minimum FFmpeg log level that will be emitted.

Declaration
public static LogLevel Level { get; set; }
Property Value
Type Description
LogLevel
View Source

Options

Gets or sets FFmpeg logging behavior flags.

Declaration
public static LogFlags Options { get; set; }
Property Value
Type Description
LogFlags
View Source

UseDefaultLogger

Gets or sets whether FFmpeg's default logging callback is invoked in addition to LogMessageReceived handlers.

Declaration
public static bool UseDefaultLogger { get; set; }
Property Value
Type Description
bool
Remarks

When enabled, log messages are forwarded to both the registered managed event handlers and FFmpeg's default logger. When disabled, registering a LogMessageReceived handler replaces FFmpeg's default logging output.

Methods

View Source

Debug(ILoggingContext, string)

Writes a debug-level message using a specific logging context.

Declaration
public static void Debug(ILoggingContext loggingContext, string message)
Parameters
Type Name Description
ILoggingContext loggingContext

The FFmpeg object providing the logging context.

string message

The message text to write.

View Source

Debug(string)

Writes a debug-level message.

Declaration
public static void Debug(string message)
Parameters
Type Name Description
string message

The message text to write.

View Source

Error(ILoggingContext, string)

Writes an error-level message using a specific logging context.

Declaration
public static void Error(ILoggingContext loggingContext, string message)
Parameters
Type Name Description
ILoggingContext loggingContext

The FFmpeg object providing the logging context.

string message

The message text to write.

View Source

Error(string)

Writes an error message.

Declaration
public static void Error(string message)
Parameters
Type Name Description
string message

The message text to write.

View Source

Fatal(ILoggingContext, string)

Writes a fatal-level message using a specific logging context.

Declaration
public static void Fatal(ILoggingContext loggingContext, string message)
Parameters
Type Name Description
ILoggingContext loggingContext

The FFmpeg object providing the logging context.

string message

The message text to write.

View Source

Fatal(string)

Writes a fatal-level message.

Declaration
public static void Fatal(string message)
Parameters
Type Name Description
string message

The message text to write.

View Source

Info(ILoggingContext, string)

Writes an informational message using a specific logging context.

Declaration
public static void Info(ILoggingContext loggingContext, string message)
Parameters
Type Name Description
ILoggingContext loggingContext

The FFmpeg object providing the logging context.

string message

The message text to write.

View Source

Info(string)

Writes an informational message.

Declaration
public static void Info(string message)
Parameters
Type Name Description
string message

The message text to write.

View Source

Panic(ILoggingContext, string)

Writes a panic-level message using a specific logging context.

Declaration
public static void Panic(ILoggingContext loggingContext, string message)
Parameters
Type Name Description
ILoggingContext loggingContext

The FFmpeg object providing the logging context.

string message

The message text to write.

View Source

Panic(string)

Writes a panic-level message.

Declaration
public static void Panic(string message)
Parameters
Type Name Description
string message

The message text to write.

View Source

Trace(ILoggingContext, string)

Writes a trace-level message using a specific logging context.

Declaration
public static void Trace(ILoggingContext loggingContext, string message)
Parameters
Type Name Description
ILoggingContext loggingContext

The FFmpeg object providing the logging context.

string message

The message text to write.

View Source

Trace(string)

Writes a trace-level message.

Declaration
public static void Trace(string message)
Parameters
Type Name Description
string message

The message text to write.

View Source

Verbose(ILoggingContext, string)

Writes a verbose-level message using a specific logging context.

Declaration
public static void Verbose(ILoggingContext loggingContext, string message)
Parameters
Type Name Description
ILoggingContext loggingContext

The FFmpeg object providing the logging context.

string message

The message text to write.

View Source

Verbose(string)

Writes a verbose-level message.

Declaration
public static void Verbose(string message)
Parameters
Type Name Description
string message

The message text to write.

View Source

Warning(ILoggingContext, string)

Writes a warning-level message using a specific logging context.

Declaration
public static void Warning(ILoggingContext loggingContext, string message)
Parameters
Type Name Description
ILoggingContext loggingContext

The FFmpeg object providing the logging context.

string message

The message text to write.

View Source

Warning(string)

Writes a warning-level message.

Declaration
public static void Warning(string message)
Parameters
Type Name Description
string message

The message text to write.

View Source

Write(ILoggingContext?, LogLevel, string)

Writes a message to the FFmpeg logging system using a specific logging context.

Declaration
public static void Write(ILoggingContext? loggingContext, LogLevel level, string message)
Parameters
Type Name Description
ILoggingContext loggingContext

The FFmpeg object providing the logging context, or null to use a context-free log message.

LogLevel level

The FFmpeg log level assigned to the message.

string message

The message text to write.

Remarks

The logging context allows FFmpeg to include object-specific information such as the component name and class category in the log callback. This method writes the message exactly as provided and does not append a newline.

View Source

Write(LogLevel, string)

Writes a message to the FFmpeg logging system.

Declaration
public static void Write(LogLevel level, string message)
Parameters
Type Name Description
LogLevel level

The FFmpeg log level assigned to the message.

string message

The message text to write.

Remarks

This method writes the message exactly as provided and does not append a newline character.

View Source

WriteLine(ILoggingContext?, LogLevel, string)

Writes a message followed by a newline character to the FFmpeg logging system using a specific logging context.

Declaration
public static void WriteLine(ILoggingContext? loggingContext, LogLevel level, string message)
Parameters
Type Name Description
ILoggingContext loggingContext

The FFmpeg object providing the logging context, or null to use a context-free log message.

LogLevel level

The FFmpeg log level assigned to the message.

string message

The message text to write.

View Source

WriteLine(LogLevel, string)

Writes a message followed by a newline character to the FFmpeg logging system.

Declaration
public static void WriteLine(LogLevel level, string message)
Parameters
Type Name Description
LogLevel level

The FFmpeg log level assigned to the message.

string message

The message text to write.

Events

View Source

LogMessageReceived

Occurs when FFmpeg produces a log message. All callbacks must be thread-safe.

Declaration
public static event LogMessageEventHandler? LogMessageReceived
Event Type
Type Description
LogMessageEventHandler
Remarks

If no handlers are registered, FFmpeg's default logging callback is used. Messages include the formatting applied by FFmpeg and may contain a trailing newline character.

  • View Source
In this article
Back to top Generated by DocFX