The data looks correct to me. You are not sending a series of responses, you are sending a single response. Every X seconds you send the next set of data. How the network breaks this up is completely up to it. You might be expecting that each time you delay it sends the previous response but that isn't how the response system works. Normally the response is buffered so it won't potentially send anything until the response is entirely written. That, of course, wouldn't work here.
To force the response to go out you have to disable buffering. Even then you need to also flush the response but note that the response could have already been sent out. That isn't an issue because the protocol can handle that.
In the MjpegStreamContent
class that sends the image disable buffering before sending the content.
public async Task ExecuteResultAsync ( ActionContext context )
{
//Disable buffering on this response so it sends it out before it is done
var responseFeature = context.HttpContext.Features.Get<IHttpResponseBodyFeature>();
responseFeature.DisableBuffering();
context.HttpContext.Response.ContentType = _contentType;
var outputStream = context.HttpContext.Response.Body;
var cancellationToken = context.HttpContext.RequestAborted;
...
Then flush the response after the writes, just to have some control.
await outputStream.WriteAsync(headerData, 0, headerData.Length, cancellationToken);
await outputStream.WriteAsync(imageBytes, 0, imageBytes.Length, cancellationToken);
await outputStream.WriteAsync(_newLine, 0, _newLine.Length, cancellationToken);
await outputStream.FlushAsync();
Note that browsers may behave differently when sending this kind of response so test in all browsers you need to support. I tried this in Chrome and it works correctly. Every couple of seconds an image is loaded. But I don't have a camera so I just wrote out the current time.