开发者

C# WPF Convert a byte array into video file?

开发者 https://www.devze.com 2023-02-05 02:48 出处:网络
I have a MPEG file which I have converted into a byte array. The intention is for a client to retrieve this byte array then save the MPEG file locally where it will be used in an WPF application.

I have a MPEG file which I have converted into a byte array. The intention is for a client to retrieve this byte array then save the MPEG file locally where it will be used in an WPF application.

I can convert the MPEG file to 开发者_运维问答a byte array, but I don't know how to convert the byte array back to MPEG or save the byte array as an MPEG file.

How do I do this?

BTW any infomation about converting a byte array to any video format which WPF supports would be helpful.


You can call File.WriteAllBytes to write a byte array to a file.

If the byte array contains a different format (eg, DivX), you'll need to transcode the file to MPEG, perhaps using ffmpeg.


What about System.IO.File.WriteAllBytes(myFileName, mpegDataByteArray)?

0

精彩评论

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

关注公众号