Skip to main content

MOV output

The MOV format is popular on Apple devices. Typically, AAC is used to encode the audio stream, and H264 or HEVC codecs are used to encode the video stream.

Use the MOVSinkSettings class to set the parameters.

Block info

Name: MOVSinkBlock.

Pin directionMedia typePins count
Input audioS32LE, S32BE, S24LE, S24BEone or more
S16LE, S16BE, S8, U8
audio/mpeg
audio/x-ac3
audio/x-adpcm
audio/x-alaw
audio/x-mulaw
audio/AMR
audio/AMR-WB
audio/x-alac
audio/x-opus
Input videoRGB, UYVY, v210one or more
video/mpeg
video/x-divx
video/x-prores
video/x-cineform
video/x-h263
video/x-h264
video/x-h265
video/x-svq
video/x-dv
image/jpeg
image/png
video/x-vp8
video/x-vp9
video/x-dirac
video/x-av1
Input subtitletext/utf8one or more

The sample pipeline

Sample code

var pipeline = new MediaBlocksPipeline();

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

var aacEncoderBlock = new AACEncoderBlock(new MFAACEncoderSettings() { Bitrate = 192 });
pipeline.Connect(fileSource.AudioOutput, aacEncoderBlock.Input);

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

var movSinkBlock = new MOVSinkBlock(new MOVSinkSettings(@"output.mov"));
pipeline.Connect(h264EncoderBlock.Output, movSinkBlock.CreateNewInput(MediaBlockPadMediaType.Video));
pipeline.Connect(aacEncoderBlock.Output, movSinkBlock.CreateNewInput(MediaBlockPadMediaType.Audio));

await pipeline.StartAsync();

Platforms

Windows, macOS, Linux, iOS, Android.