Class Logger
Provides access to the global FFmpeg logging system.
Inherited Members
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 SourceIncludePrefix
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.
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 |
Options
Gets or sets FFmpeg logging behavior flags.
Declaration
public static LogFlags Options { get; set; }
Property Value
| Type | Description |
|---|---|
| LogFlags |
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 SourceDebug(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. |
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. |
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. |
Error(string)
Writes an error message.
Declaration
public static void Error(string message)
Parameters
| Type | Name | Description |
|---|---|---|
| string | message | The message text to write. |
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. |
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. |
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. |
Info(string)
Writes an informational message.
Declaration
public static void Info(string message)
Parameters
| Type | Name | Description |
|---|---|---|
| string | message | The message text to write. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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.
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.
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. |
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 SourceLogMessageReceived
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.