Skip to main content

Universal source block

A universal source that decodes video and audio files/network streams and provides uncompressed data to the connected blocks.

Block supports MP4, WebM, AVI, TS, MKV, MP3, AAC, M4A, and many other formats. If FFMPEG redist is available, all decoders available in FFMPEG will also be supported.

Block info

Name: UniversalSourceBlock.

Pin directionMedia typePins count
Output audiodepends from decoderone or more
Output videodepends from decoderone or more
Output subtitledepends from decoderone or more

The sample pipeline

Sample code

var pipeline = new MediaBlocksPipeline();

var fileSource = new UniversalSourceBlock();
fileSource.Filename = "test.mp4";

var videoRenderer = new VideoRendererBlock(pipeline, VideoView1);
pipeline.Connect(fileSource.VideoOutput, videoRenderer.Input);

var audioRenderer = new AudioRendererBlock();
pipeline.Connect(fileSource.AudioOutput, audioRenderer.Input);

await pipeline.StartAsync();

Sample applications

Platforms

Windows, macOS, Linux, iOS, Android.