Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

c# Streaming downgraded-quality video over HTTP

I have very large high quality videos that I need to stream over HTTP (for mobile devices). It is not possible to use ffmpeg to create a "streaming" version of the video.

I must also still support HTTP's seek/begin feature so that the user may skip ahead in the video.

I am using ServiceStack (not IIS).

Are there any options available out there?

I have access to the server, so any third party services are acceptable.

like image 874
Paul Knopf Avatar asked Apr 29 '13 12:04

Paul Knopf


1 Answers

We've recently added Partial Content support both in directly serving Static files as well as via a Web Service. This will be available in v3.9.44 release of ServiceStack on NuGet which is planned for this weekend (you can build ServiceStack from the repo if you need it before then).

Partial Content support will be automatically enabled where it will be available to seek/stream any static file (served through ServiceStack) as well as any Service that:

returns a file:

return new HttpResult(new FileInfo(filePath), request.MimeType);

returns bytes:

return new HttpResult(byteArray, "audio/mpeg");

returns a stream:

return new HttpResult(memoryStream, "audio/mpeg");

returns a raw string:

return new HttpResult(customText, "text/plain");

To disable Partial Content support set:

Config.AllowPartialResponses = false;
like image 64
mythz Avatar answered Sep 26 '22 18:09

mythz