Skip to main content

FFMPEG.exe output

Products: Video Capture SDK .Net, Video Edit SDK .Net

SDKs provide file output using FFMPEG.exe.

FFMPEG, a versatile and powerful multimedia framework, supports an extensive range of output formats, including but not limited to MP4, WebM, AVI, and WMV. It is renowned for its compatibility with a multitude of video and audio encoders, each providing a variety of customizable settings to cater to different encoding needs.

FFMPEG also seamlessly integrates with hardware encoders like Intel QuickSync, NVidia NVENC, and AMD AMF/VCE, enhancing its efficiency and performance in processing multimedia files.

The same sample code can be used for Video Edit SDK .Net. Use the VideoEditCore class instead of VideoCaptureCore.

Sample code

Create FFMPEGEXEOutput object

var ffmpegOutput = new FFMPEGEXEOutput();

Specify the output muxer (MP4, WebM, AVI, etc.)

ffmpegOutput.OutputMuxer = OutputMuxer.MP4;

Apple video encoder settings

var videoEncoder = new H264MFSettings();

// configure video encoder
// ...

ffmpegOutput.Video = videoEncoder;

Supported video encoder classes

  • H264AMFSettings (AMD GPU H264 encoder)
  • H264MFSettings (CPU H264 encoder)
  • H264NVENCSettings (Nvidia GPU H264 encoder)
  • H264QSVSettings (Intel QuickSync H264 encoder)
  • X264Settings (CPU H264 encoder)
  • HEVCAMFSettings (AMD GPU HEVC encoder)
  • HEVCNVENCSettings (Nvidia GPU HEVC encoder)
  • HEVCQSVSettings (Intel QuickSync HEVC encoder)
  • X265Settings (CPU HEVC encoder)
  • MPEG2Settings (MPEG-2 CPU encoder)

x264/x265 encoders can be used with alternative GPL FFMPEG builds that contain it.

Apply audio encode settings

var audioEncoder = new BasicAudioSettings();

// configure audio encoder
audioEncoder.Bitrate = 192000;
audioEncoder.Channels = 2;
audioEncoder.SampleRate = 44100;
audioEncoder.Encoder = AudioEncoder.AAC;
audioEncoder.Mode = AudioMode.CBR;

ffmpegOutput.Audio = audioEncoder;

You can check the VisioForge.Core.Types.FFMPEGEXE.AudioEncoder enum for available audio encoders.

Set FFMPEG format settings for output

core.Output_Format = ffmpegOutput;

Set the video capture mode (or video convert mode if you use Video Edit SDK)

core.Mode = VideoCaptureMode.VideoCapture;

Set the file name (be sure that you have to write access rights)

core.Output_Filename = "output.mp4";

Start capture (or convert)

await core.StartAsync();

Required redists

  • Video Capture SDK redist x86 x64
  • Video Edit SDK redist x86 x64 -FFMPEG EXE redist x86 x64

Visit our GitHub page to get more code samples.