VAVideoCompressor
VAVideoCompressor copied to clipboard
readyForMoreMediaData crash
Cannot append sample buffer: readyForMoreMediaData is NO
private static func encodeReadySamplesFromOutput(
_ output: AVAssetReaderOutput,
input: AVAssetWriterInput,
reader: AVAssetReader,
writer: AVAssetWriter
) -> Bool {
let readyForMediaCondition = NSCondition()
while input.isReadyForMoreMediaData {
readyForMediaCondition.wait()
if let sampleBuffer = output.copyNextSampleBuffer() {
if reader.status != .reading || writer.status != .writing {
return false
}
if !input.append(sampleBuffer) {
return false
}
} else {
input.markAsFinished()
return false
}
}
return true
}
Same error, some possible solution.
@MRodSebastian the snippet you posted doesn't let the compression finish in my project. did you ever get a fix working on your end?
@MRodSebastian the snippet you posted doesn't let the compression finish in my project. did you ever get a fix working on your end?
Sorry but this snippet worked for me and i dont know you environment (if you save video in local or temp, url format...). But still this compressor kept giving me problems in the compression process and I had to change it and use another compressor and still modify the compressor.
@MRodSebastian ah gotcha. Checking out some other compressor options. Thanks for replying! :)
Exactly the issue is still there, and the new snippet is never-ending compression, It's a failed code.