Struct OutputFormat
Represents an output format in the FFmpeg library.
Inherited Members
Namespace: FFmpeg.Formats
Assembly: FFmpeg.dll
Syntax
public readonly struct OutputFormat
Remarks
This struct provides access to various properties and methods related to output formats, including supported codecs, default codecs, and format flags.
Properties
View SourceAAC
Gets the ADTS AAC output format (Advanced Audio Coding).
Declaration
public static OutputFormat? AAC { get; }
Property Value
| Type | Description |
|---|---|
| OutputFormat? |
ALAC
Gets the Apple Lossless Audio Codec (ALAC) output format.
Declaration
public static OutputFormat? ALAC { get; }
Property Value
| Type | Description |
|---|---|
| OutputFormat? |
APNG
Gets the APNG output format.
Declaration
public static OutputFormat? APNG { get; }
Property Value
| Type | Description |
|---|---|
| OutputFormat? |
ASS
Gets the SSA (SubStation Alpha) subtitle output format.
Declaration
public static OutputFormat? ASS { get; }
Property Value
| Type | Description |
|---|---|
| OutputFormat? |
AVI
Gets the AVI output format.
Declaration
public static OutputFormat? AVI { get; }
Property Value
| Type | Description |
|---|---|
| OutputFormat? |
AVIF
Gets the AVIF output format (AV1 Image File Format).
Declaration
public static OutputFormat? AVIF { get; }
Property Value
| Type | Description |
|---|---|
| OutputFormat? |
BMP
Gets the BMP output format (Bitmap).
Declaration
public static OutputFormat? BMP { get; }
Property Value
| Type | Description |
|---|---|
| OutputFormat? |
BMP_Pipe
Gets the piped BMP output format.
Declaration
public static OutputFormat? BMP_Pipe { get; }
Property Value
| Type | Description |
|---|---|
| OutputFormat? |
DASH
Gets the DASH (Dynamic Adaptive Streaming over HTTP) output format.
Declaration
public static OutputFormat? DASH { get; }
Property Value
| Type | Description |
|---|---|
| OutputFormat? |
DefaultAudioCodec
Gets the default audio codec for this output format.
Declaration
public CodecID DefaultAudioCodec { get; }
Property Value
| Type | Description |
|---|---|
| CodecID |
Remarks
This represents the codec used for audio streams by default when the format is selected.
DefaultSubtitleCodec
Gets the default subtitle codec for this output format.
Declaration
public CodecID DefaultSubtitleCodec { get; }
Property Value
| Type | Description |
|---|---|
| CodecID |
Remarks
This represents the codec used for subtitle streams by default when the format is selected.
DefaultVideoCodec
Gets the default video codec for this output format.
Declaration
public CodecID DefaultVideoCodec { get; }
Property Value
| Type | Description |
|---|---|
| CodecID |
Remarks
This represents the codec used for video streams by default when the format is selected.
Extensions
Gets a read-only list of file extensions associated with the output format.
Declaration
public IReadOnlyList<string> Extensions { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<string> |
Remarks
File extensions are used to identify files of this format. This property retrieves and splits the extensions from a comma-separated string. Returns an empty list if no extensions are available.
FLAC
Gets the FLAC output format (Free Lossless Audio Codec).
Declaration
public static OutputFormat? FLAC { get; }
Property Value
| Type | Description |
|---|---|
| OutputFormat? |
FLV
Gets the Flash Video output format.
Declaration
public static OutputFormat? FLV { get; }
Property Value
| Type | Description |
|---|---|
| OutputFormat? |
Flags
Gets the flags associated with this output format.
Declaration
public FormatFlags Flags { get; }
Property Value
| Type | Description |
|---|---|
| FormatFlags |
Remarks
Format flags provide information about the capabilities and properties of the format, such as whether it supports certain features or has specific characteristics.
GIF
Gets the GIF output format (CompuServe Graphics Interchange Format).
Declaration
public static OutputFormat? GIF { get; }
Property Value
| Type | Description |
|---|---|
| OutputFormat? |
HLS
Gets the HTTP Live Streaming (HLS) output format.
Declaration
public static OutputFormat? HLS { get; }
Property Value
| Type | Description |
|---|---|
| OutputFormat? |
JPEG
Gets the JPEG output format (Joint Photographic Experts Group).
Declaration
public static OutputFormat? JPEG { get; }
Property Value
| Type | Description |
|---|---|
| OutputFormat? |
JPEGXL
Gets the JPEG XL output format.
Declaration
public static OutputFormat? JPEGXL { get; }
Property Value
| Type | Description |
|---|---|
| OutputFormat? |
JPEG_Pipe
Gets the piped JPEG output format.
Declaration
public static OutputFormat? JPEG_Pipe { get; }
Property Value
| Type | Description |
|---|---|
| OutputFormat? |
LongName
Gets the long name of the output format.
Declaration
public string LongName { get; }
Property Value
| Type | Description |
|---|---|
| string |
Remarks
The long name provides a more descriptive name for the format compared to the short name.
MKV
Gets the Matroska output format.
Declaration
public static OutputFormat? MKV { get; }
Property Value
| Type | Description |
|---|---|
| OutputFormat? |
MOV
Gets the MOV output format (QuickTime / MOV).
Declaration
public static OutputFormat? MOV { get; }
Property Value
| Type | Description |
|---|---|
| OutputFormat? |
MP3
Gets the MP3 output format (MPEG audio layer 3).
Declaration
public static OutputFormat? MP3 { get; }
Property Value
| Type | Description |
|---|---|
| OutputFormat? |
MP4
Gets the MP4 output format (MPEG-4 Part 14).
Declaration
public static OutputFormat? MP4 { get; }
Property Value
| Type | Description |
|---|---|
| OutputFormat? |
MPEG
Gets the MPEG output format (MPEG-1 Systems / MPEG program stream).
Declaration
public static OutputFormat? MPEG { get; }
Property Value
| Type | Description |
|---|---|
| OutputFormat? |
MPEGTS
Gets the MPEG-TS output format (MPEG-2 Transport Stream).
Declaration
public static OutputFormat? MPEGTS { get; }
Property Value
| Type | Description |
|---|---|
| OutputFormat? |
MimeTypes
Gets a read-only list of MIME types associated with the output format.
Declaration
public IReadOnlyList<string> MimeTypes { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<string> |
Remarks
MIME types represent the media type of the format and are useful for content negotiation. This property retrieves and splits the MIME types from a comma-separated string.
NULL
Gets the NULL output format.
Declaration
public static OutputFormat? NULL { get; }
Property Value
| Type | Description |
|---|---|
| OutputFormat? |
OGA
Gets the Oga output format.
Declaration
public static OutputFormat? OGA { get; }
Property Value
| Type | Description |
|---|---|
| OutputFormat? |
OGG
Gets the Ogg output format.
Declaration
public static OutputFormat? OGG { get; }
Property Value
| Type | Description |
|---|---|
| OutputFormat? |
OGV
Gets the Ogv output format.
Declaration
public static OutputFormat? OGV { get; }
Property Value
| Type | Description |
|---|---|
| OutputFormat? |
PNG
Gets the PNG output format (Portable Network Graphics).
Declaration
public static OutputFormat? PNG { get; }
Property Value
| Type | Description |
|---|---|
| OutputFormat? |
PNG_Pipe
Gets the piped PNG output format.
Declaration
public static OutputFormat? PNG_Pipe { get; }
Property Value
| Type | Description |
|---|---|
| OutputFormat? |
SRT
Gets the SubRip subtitle output format.
Declaration
public static OutputFormat? SRT { get; }
Property Value
| Type | Description |
|---|---|
| OutputFormat? |
ShortName
Gets the short name of the output format.
Declaration
public string ShortName { get; }
Property Value
| Type | Description |
|---|---|
| string |
Remarks
The short name is a concise identifier for the format, often used for quick reference.
SupportedCodecs
Gets the list of supported codecs for this output format.
Declaration
public IReadOnlyList<CodecTag> SupportedCodecs { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<CodecTag> |
Remarks
This property iterates through the codec tags associated with the format to collect the supported codec IDs.
TIFF
Gets the TIFF output format (Tagged Image File Format).
Declaration
public static OutputFormat? TIFF { get; }
Property Value
| Type | Description |
|---|---|
| OutputFormat? |
TIFF_Pipe
Gets the piped TIFF output format.
Declaration
public static OutputFormat? TIFF_Pipe { get; }
Property Value
| Type | Description |
|---|---|
| OutputFormat? |
WAV
Gets the WAV output format (Waveform Audio).
Declaration
public static OutputFormat? WAV { get; }
Property Value
| Type | Description |
|---|---|
| OutputFormat? |
WEBM
Gets the WebM output format.
Declaration
public static OutputFormat? WEBM { get; }
Property Value
| Type | Description |
|---|---|
| OutputFormat? |
WebP
Gets the WebP output format.
Declaration
public static OutputFormat? WebP { get; }
Property Value
| Type | Description |
|---|---|
| OutputFormat? |
Methods
View SourceFindFormat(string)
Finds an output format by its short name.
Declaration
public static OutputFormat? FindFormat(string short_name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | short_name | The short name of the output format. |
Returns
| Type | Description |
|---|---|
| OutputFormat? | An OutputFormat instance if found; otherwise, |
GetOutputFormats()
Retrieves a collection of available AV output formats.
Declaration
public static IReadOnlyList<OutputFormat> GetOutputFormats()
Returns
| Type | Description |
|---|---|
| IReadOnlyList<OutputFormat> | An IReadOnlyList<T> containing all available output formats. |
Remarks
This method uses the FFmpeg library to iterate through all available muxers and collects them into a list of OutputFormat objects.
GuessOutputFormat(string?, string?, string?)
Guesses an output format based on the provided parameters.
Declaration
public static OutputFormat? GuessOutputFormat(string? short_name = null, string? filename = null, string? mime_type = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | short_name | The short name of the format. |
| string | filename | The filename to guess the format from. |
| string | mime_type | The MIME type to guess the format from. |
Returns
| Type | Description |
|---|---|
| OutputFormat? | An OutputFormat instance if found; otherwise, |
ToString()
Returns a string representation of the output format.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | The LongName of the output format. |