开发者

C# byte array to video

开发者 https://www.devze.com 2023-02-17 17:52 出处:网络
Need to convert byte arrays of images and videos back to its origin. I know how to do it for images as shown below.

Need to convert byte arrays of images and videos back to its origin. I know how to do it for images as shown below.

MemoryStream strea开发者_Go百科m = new MemoryStream(byteArray);
Bitmap bitMap = (Bitmap)Bitmap.FromStream(stream);

But I haven't found a good way to do this conversion of byte arrays of videos. Was looking into the System.Drawing.Image namespace, but that namespace is only for images.

Any advice appreciated, thanks :-)


When you say "conversion of byte arrays of videos", what are you expecting, and why do you want a Video object, and what would you do with it?

The .NET Framework doesn't have an equivalent of Bitmap for video if your intention is to edit it. There are a lot of 3rd party APIs that can do that for you, or if you wanted you could work with something like DirectShow using the DXSlim wrapper around DirectX.


Your problem here is knowing the format of the video, making sure codecs are available, etc. It's not like a bitmap in which there is a universal standard.

You will probably want to start with the new Microsoft Media Foundation if you're trying to do editing or play something with an obscure codec. It's going to be a lot of work. You might do better to use Silverlight here if you're going to be streaming and if you have control over the format.

0

精彩评论

暂无评论...
验证码 换一张
取 消