Skip to main content

HTTP source block

The HTTP source block allows data to be retrieved using HTTP/HTTPS protocols. It can be used to read data from MJPEG IP cameras, MP4 network files, or other sources.

Block info

Name: HTTPSourceBlock.

Pin directionMedia typePins count
OutputData1

The sample pipeline

The sample pipeline reads data from an MJPEG camera and displays it using VideoView.

Sample code

var pipeline = new MediaBlocksPipeline();

var settings = new HTTPSourceSettings(new Uri("http://mjpegcamera:8080"))
{
UserID = "username",
UserPassword = "password"
};

var source = new HTTPSourceBlock(settings);
var videoRenderer = new VideoRendererBlock(pipeline, VideoView1);
var jpegDecoder = new JPEGDecoderBlock();

pipeline.Connect(source.Output, jpegDecoder.Input);
pipeline.Connect(jpegDecoder.Output, videoRenderer.Input);

await pipeline.StartAsync();

Sample applications

Platforms

Windows, macOS, Linux.