问题描述
我们在我的应用程序 xamarin 形式 ios 中使用捕获的视频功能。捕获视频后,我们将压缩视频并将其上传到网络服务器。压缩视频上的音频失真。这是视频压缩代码:
string fileName = Path.GetFileNameWithoutExtension(inputPath);
string outputPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal),fileName + ".mp4");
taskcompletionsource<string> tcs = new taskcompletionsource<string>();
var outputURL = new NSUrl(outputPath);
NSError error = new NSError();
using (AVAsset asset = AVAsset.FromUrl(NSUrl.FromFilename(inputPath)))
using (AVAssetExportSession export = new AVAssetExportSession(asset,AVAssetExportSessionPreset.MediumQuality))
{
export.OutputFileType = AVFileType.Mpeg4;
export.ShouldOptimizeforNetworkUse = true;
export.OutputUrl = NSUrl.FromFilename(outputURL.ToString());
NSFileManager.DefaultManager.Remove(outputURL,out error);
export.ExportTaskAsync();
Stream exportStream = File.OpenRead(tmp);
如何在 xamarin 形式的 ios 中解决这个问题?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)