Class FFMPEGOutput
- Namespace
- VisioForge.Core.Types.Output
- Assembly
- VisioForge.Core.dll
Represents configuration settings for FFMPEG-based output, providing flexible video and audio encoding with a wide range of codec and format support.
public sealed class FFMPEGOutput : IVideoEditBaseOutput, IVideoCaptureBaseOutput, INetworkStreamingOutputInheritance
Implements
Inherited Members
Remarks
FFMPEG (Fast Forward MPEG) is a powerful multimedia framework capable of encoding, decoding, and transcoding virtually any media format. This output class provides access to FFMPEG's encoding capabilities with extensive control over video and audio parameters.
Key features:
- Support for numerous video codecs (H.264, H.265, VP8, VP9, MPEG-2, MPEG-4, etc.)
- Multiple audio codecs (AAC, MP3, Vorbis, Opus, etc.)
- Various container formats (MP4, MKV, WebM, AVI, etc.)
- Fine-grained control over bitrate, quality, and encoding parameters
- Hardware acceleration support (when available)
This output format is ideal when you need:
- Maximum format flexibility
- Cross-platform compatibility
- Access to advanced encoding features
- Support for modern codecs like VP9 or AV1
Constructors
FFMPEGOutput()
Initializes a new instance of the VisioForge.Core.Types.Output.FFMPEGOutput class with default settings.
public FFMPEGOutput()Remarks
Default configuration:
- Output format: MP4
- Video codec: MPEG-4
- Video resolution: 640x480
- Video bitrate: Automatic (0 = FFMPEG default)
- Audio codec: AAC
- Audio: Stereo, 48000 Hz, 192 kbps
- Aspect ratio: 1:1 (square pixels)
- TV system: None (progressive scan)
- Buffer size: 2000 kilobits
These defaults provide a good starting point for most encoding scenarios. Adjust properties as needed for specific requirements.
Properties
Audio_Bitrate
Gets or sets the audio bitrate in bits per second.
public int Audio_Bitrate { get; set; }Property Value
Remarks
Higher bitrates provide better audio quality but increase file size. Typical values:
- 64 kbps: Voice/podcasts
- 128 kbps: General use
- 192 kbps: High quality music
- 256-320 kbps: Maximum quality
Audio_Channels
Gets or sets the number of audio channels.
public int Audio_Channels { get; set; }Property Value
Remarks
Common configurations:
- 1: Mono
- 2: Stereo (recommended for most applications)
- 6: 5.1 surround (if supported by codec)
Audio_Codec
Gets or sets the audio codec to use for encoding.
public FFMPEGAudioCodec Audio_Codec { get; set; }Property Value
Remarks
The audio codec affects audio quality, compression ratio, and compatibility. AAC is recommended for most modern applications.
Audio_SampleRate
Gets or sets the audio sample rate in Hz.
public int Audio_SampleRate { get; set; }Property Value
Remarks
Standard sample rates:
- 44100 Hz: CD quality, music
- 48000 Hz: Professional audio/video (recommended)
- 96000 Hz: High-resolution audio
OutputFormat
Gets or sets the output container format.
public FFMPEGOutputFormat OutputFormat { get; set; }Property Value
Remarks
The output format determines the file container and extension:
- MP4: Widely compatible, good for web and mobile
- MKV: Open format, supports many features
- WebM: Optimized for web streaming
- AVI: Legacy format, broad compatibility
Ensure the selected format is compatible with your chosen codecs.
Video_AspectRatio_H
Gets or sets the video aspect ratio height component.
public int Video_AspectRatio_H { get; set; }Property Value
Remarks
Used with VisioForge.Core.Types.Output.FFMPEGOutput.Video_AspectRatio_W to define aspect ratio. Common aspect ratios: 4:3, 16:9, 16:10, 21:9.
Video_AspectRatio_W
Gets or sets the video aspect ratio width component.
public int Video_AspectRatio_W { get; set; }Property Value
Remarks
Used with VisioForge.Core.Types.Output.FFMPEGOutput.Video_AspectRatio_H to define aspect ratio. Common aspect ratios: 4:3, 16:9, 16:10, 21:9.
Video_Bitrate
Gets or sets the target video bitrate in bits per second.
public int Video_Bitrate { get; set; }Property Value
Remarks
Higher bitrates produce better quality but larger files. Example values:
- 1-2 Mbps: Web video (480p)
- 3-5 Mbps: Standard quality (720p)
- 8-12 Mbps: High quality (1080p)
- 20-50 Mbps: Very high quality/4K
Video_BufferSize
Gets or sets the video buffer size in kilobits.
public int Video_BufferSize { get; set; }Property Value
Remarks
Controls the Video Buffering Verifier (VBV) buffer size. Affects how bitrate fluctuations are handled during encoding. Larger buffers allow more bitrate variation but may not be suitable for streaming.
Video_Codec
Gets or sets the video codec to use for encoding.
public FFMPEGVideoCodec Video_Codec { get; set; }Property Value
Remarks
The video codec determines the compression algorithm and quality characteristics. Choose based on your target platform, quality requirements, and file size constraints.
Video_Height
Gets or sets the output video height in pixels.
public int Video_Height { get; set; }Property Value
Remarks
When both width and height are non-zero, the video will be resized. Common heights: 480 (SD), 720 (HD), 1080 (Full HD), 2160 (4K).
Video_Interlace
Gets or sets a value indicating whether the output video should be encoded as interlaced.
public bool Video_Interlace { get; set; }Property Value
Remarks
Interlaced encoding is typically only needed for broadcast television (PAL/NTSC) compatibility. Most modern applications use progressive (non-interlaced) video.
Video_Level
Gets or sets the video encoding level for H.264, H.265 (HEVC), MPEG-2, and VP9 codecs.
public FFMPEGVideoLevel Video_Level { get; set; }Property Value
Remarks
Levels specify maximum resolution, framerate, and bitrate combinations:
- Lower levels: Compatible with more devices but limit resolution/quality
- Higher levels: Support 4K and high bitrates but require modern hardware
Choose based on target device capabilities and content requirements.
Video_MaxBitrate
Gets or sets the maximum video bitrate in bits per second for variable bitrate encoding.
public int Video_MaxBitrate { get; set; }Property Value
Remarks
Used in variable bitrate (VBR) mode to prevent bitrate spikes. Should be higher than VisioForge.Core.Types.Output.FFMPEGOutput.Video_Bitrate (target bitrate).
Video_MinBitrate
Gets or sets the minimum video bitrate in bits per second for variable bitrate encoding.
public int Video_MinBitrate { get; set; }Property Value
Remarks
Used in variable bitrate (VBR) mode to maintain minimum quality. Should be lower than VisioForge.Core.Types.Output.FFMPEGOutput.Video_Bitrate (target bitrate).
Video_Profile
Gets or sets the video encoding profile for H.264, H.265 (HEVC), MPEG-2, and VP9 codecs.
public FFMPEGVideoProfile Video_Profile { get; set; }Property Value
Remarks
Profiles define feature sets and compatibility levels:
- Baseline: Maximum compatibility, limited features
- Main: Good compatibility with modern features
- High: Advanced features, best quality
Higher profiles may not be compatible with older devices.
Video_TVSystem
Gets or sets the TV system standard for broadcast compatibility.
public FFMPEGTVSystem Video_TVSystem { get; set; }Property Value
Remarks
Only relevant when creating content for broadcast television. Sets appropriate framerate and resolution for NTSC, PAL, or SECAM standards. For most applications, use VisioForge.Core.Types.Output.FFMPEGTVSystem.None.
Video_Width
Gets or sets the output video width in pixels.
public int Video_Width { get; set; }Property Value
Remarks
When both width and height are non-zero, the video will be resized. Consider aspect ratio when setting dimensions to avoid distortion.
Methods
GetInternalTypeVC()
Gets the internal output format identifier for video capture operations.
public VideoCaptureOutputFormat GetInternalTypeVC()Returns
- VideoCaptureOutputFormat
-
Returns VisioForge.Core.Types.VideoCapture.VideoCaptureOutputFormat.FFMPEG to indicate this is an FFMPEG-based output format.
Remarks
This method is used internally by the video capture system to identify the output format type and configure the appropriate encoding pipeline using FFMPEG libraries.
GetInternalTypeVE()
Gets the internal output format identifier for video editing operations.
public VideoEditOutputFormat GetInternalTypeVE()Returns
- VideoEditOutputFormat
-
Returns VisioForge.Core.Types.VideoEdit.VideoEditOutputFormat.FFMPEG to indicate this is an FFMPEG-based output format.
Remarks
This method is used internally by the video editing system to identify the output format type and configure the appropriate encoding pipeline using FFMPEG libraries.
Load(string)
Deserializes FFMPEG output settings from a JSON string.
public static FFMPEGOutput Load(string json)Parameters
jsonstring-
The JSON string containing the serialized FFMPEG output settings.
Returns
- FFMPEGOutput
-
A new VisioForge.Core.Types.Output.FFMPEGOutput instance with all settings restored from the JSON string.
Remarks
This method restores all codec settings, bitrates, resolution parameters, and other configuration from a previously serialized state using the VisioForge.Core.Types.Output.FFMPEGOutput.Save method.
Exceptions
- JsonException
-
Thrown when the JSON string is invalid or cannot be deserialized to an FFMPEGOutput object.
Save()
Serializes the current FFMPEG output settings to a JSON string.
public string Save()Returns
- string
-
A JSON string representation of all configuration settings including video and audio parameters.
Remarks
The resulting JSON can be used to restore the settings later using the VisioForge.Core.Types.Output.FFMPEGOutput.Load(System.String) method. All encoding parameters including codec selection, bitrates, resolution, and format options are preserved.