Changing the Quality of a Stream Video C #

4

I need to change the quality of a video that is being scanned by my Api, I'm already sending the file, now I need to change the quality of it at the time of transmission, follow my code below:

               var buffer = new byte[65536];

                using (var video = File.Open(_filename, FileMode.Open, FileAccess.Read))
                {
                    var length = (int)video.Length;
                    var bytesRead = 1;

                    while (length > 0 && bytesRead > 0)
                    {
                        bytesRead = video.Read(buffer, 0, Math.Min(length, buffer.Length));
                        await outputStream.WriteAsync(buffer, 0, bytesRead);
                        length -= bytesRead;
                    }
                }

Is there any way to change at the time of streaming or do I need to physically have it in other qualities?

    
asked by anonymous 01.09.2015 / 16:26

1 answer

1

As Gypsy Morrison commented. The video quality is not set at the time of transmitting the stream, but rather in the encode of the video.

If you are using physical files you will need to have "copies" of them encoded with the features you expect. You can even automate the process by using the FFmpeg library

For live broadcasts, you can configure profiles, endpoints for quality variations, or deliver the content in tracks displayed in a manifest for Adaptive bitrate Streaming or Smooth Stream.     

09.12.2015 / 20:07