關(guān)鍵問題代碼:
AVAssetExportsession *exportSession............
exportSession.outputURL = *******;
這里表示壓縮轉(zhuǎn)碼后的輸出路徑 之前一直弄錯(cuò)了
經(jīng)過修改后 如下
exportSession.outputURL = [NSURL URLWithString:[NSStringstringWithFormat:@"%@/Library/Caches/movie_%@.mp4",NSHomeDirectory(), [UtilstringFromDate:[NSDatedate]withFormat:@"yyyy-MM-dd"]]]
終于 還是失敗了
心里郁悶 千萬草 奈何還得繼續(xù)碼
仔細(xì)排查 發(fā)現(xiàn)不能用 URLWithString
更改為
fileURLWithPath
exportSession.outputURL = [NSURL fileURLWithPath:[NSStringstringWithFormat:@"%@/Library/Caches/movie_%@.mp4",NSHomeDirectory(), [UtilstringFromDate:[NSDatedate] withFormat:@"yyyy-MM-dd"]]];
激動(dòng) 淚奔
exportSession.status 結(jié)果為3
成功轉(zhuǎn)碼
AVAssetExportSessionStatusCompleted;
新聞熱點(diǎn)
疑難解答
圖片精選
網(wǎng)友關(guān)注