Skip to main content

MXF output

MXF (Material Exchange Format): A container format designed for professional digital video and audio media, defined by SMPTE standards. It is used in the broadcasting industry to support stream-based workflows with full metadata and timecode support.

Use the MXFSinkSettings class to set the parameters.

Block info

Name: MXFSinkBlock.

Pin directionMedia typePins count
Input audioPCM (S16, S24, S32, U8)one or more
audio/x-alaw
audio/x-ac3
audio/mpeg [1,2]
Input videovideo/mpeg [1,2,4]one or more
video/x-dv
video/x-h264
video/x-dnxhd
RGB/RGBA/YUV
image/x-jpc

The sample pipeline

Sample code

var pipeline = new MediaBlocksPipeline();

var filename = "test.mp4";
var fileSource = new UniversalSourceBlock(await UniversalSourceSettings.CreateAsync(new Uri(filename)));

var audioEncoderBlock = new MP2EncoderBlock(new MP2EncoderSettings() { Bitrate = 192 });
pipeline.Connect(fileSource.AudioOutput, audioEncoderBlock.Input);

var h264EncoderBlock = new H264EncoderBlock(new MFH264EncoderSettings());
pipeline.Connect(fileSource.VideoOutput, h264EncoderBlock.Input);

var sinkBlock = new MXFSinkBlock(new MXFSinkSettings(@"output.mxf", MXFVideoStreamType.H264, MXFAudioStreamType.MPEG));
pipeline.Connect(h264EncoderBlock.Output, sinkBlock.CreateNewInput(MediaBlockPadMediaType.Video));
pipeline.Connect(audioEncoderBlock.Output, sinkBlock.CreateNewInput(MediaBlockPadMediaType.Audio));

await pipeline.StartAsync();

Platforms

Windows, macOS, Linux, iOS, Android.