如何转换base64格式的视频文件 [英] How can convert video file in base64 format
本文介绍了如何转换base64格式的视频文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将视频文件转换为base64以获取xml格式
我尝试过:
var bytes [] = File.ReadAllBytes(filepath);
解决方案
如果它是无关紧要的视频或音频或任何其他类型的文件或字节数组。 base64的输入是一个字节数组,它不关心语义内容。
CodeProject上有几篇文章介绍base64编码和-decoding ,看一看:搜索 - CodeProject [< a href =http://www.codeproject.com/search.aspx?q=base64&x=0&y=0&sbo=kwtarget =_ blanktitle =New Window> ^ ]
这不是真正的转换 - 请参阅解决方案1.
就在这里:
Convert.ToBase64String方法(字节[])(系统) [ ^ ],
Convert.FromBase64String方法(字符串)(系统) [ ^ ]。
然而,整个想法看起来很值得怀疑。
-SA
i wanted to convert a video file into base64 to get it in xml format
What I have tried:
var bytes[] = File.ReadAllBytes("filepath");
解决方案
It doesn't matter if it's a video or audio or any other sort of file or byte-array. The input for base64 is a byte-array and it doesn't care for the semantic content.
There are several articles here on CodeProject presenting base64-encoding and -decoding, take a look: Search - CodeProject[^]
This is not really a "conversion" — please see Solution 1.
It's here:
Convert.ToBase64String Method (Byte[]) (System)[^],
Convert.FromBase64String Method (String) (System)[^].
However, the whole idea looks quite questionable.
—SA
这篇关于如何转换base64格式的视频文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文