草庐IT

estimatedOutputFileLength

全部标签

iphone - AVAssetExportSession estimatedOutputFileLength 总是返回 0

AVAssetExportSession的estimatedOutputFileLength属性总是返回0(并返回-9223372036854775808模拟器)。我已尽一切努力让它工作,尝试不同的outputFileType,打开和关闭shouldOptimizeForNetworkUse,指定(或不指定)outputURL...尽管如此,似乎没有任何效果,我开始认为这可能是SDK中的错误。这是我的代码:AVAssetExportSession*exportSession=[[AVAssetExportSessionalloc]initWithAsset:assetpresetNam

ios - AVAssetExportSession fileLengthLimit 被忽略并且 estimatedOutputFileLength 返回 0

我正在使用AVAssetExportSession重新编码视频,我想尝试将生成的文件大小保持在限制以下。我的最终调用如下所示:NSArray*compatiblePresets=[AVAssetExportSessionexportPresetsCompatibleWithAsset:avAsset];if([compatiblePresetscontainsObject:AVAssetExportPresetMediumQuality]){AVAssetExportSession*exportSession=[[AVAssetExportSessionalloc]initWithAs