我希望在将视频上传到网络服务之前对其进行压缩。为此,我使用下面的代码,但我总是解码错误。能帮我解决这个问题。
代码:
AVAssetExportSession session = AVAssetExportSession.FromAsset(asset,AVAssetExportSession.PresetLowQuality);
session.OutputUrl = outputUrl;
session.OutputFileType = AVFileType.QuickTimeMovie;
session.ExportAsynchronously(() =>
{
var exportError = session.Error;
var exportStatus = session.Status;
if (session.Status == AVAssetExportSessionStatus.Completed)
{
Debug.WriteLine("Video Completed");
}else{
Debug.WriteLine("Video Error");
}
});