VAVideoCompressor icon indicating copy to clipboard operation
VAVideoCompressor copied to clipboard

readyForMoreMediaData crash

Open UtkuDalmaz opened this issue 4 years ago • 5 comments

Cannot append sample buffer: readyForMoreMediaData is NO

UtkuDalmaz avatar Mar 17 '20 11:03 UtkuDalmaz

  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.

manucodin avatar Apr 16 '20 06:04 manucodin

@MRodSebastian the snippet you posted doesn't let the compression finish in my project. did you ever get a fix working on your end?

malonehedges avatar May 14 '20 22:05 malonehedges

@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.

manucodin avatar May 17 '20 11:05 manucodin

@MRodSebastian ah gotcha. Checking out some other compressor options. Thanks for replying! :)

malonehedges avatar May 18 '20 17:05 malonehedges

Exactly the issue is still there, and the new snippet is never-ending compression, It's a failed code.

Razanajam avatar Oct 19 '20 10:10 Razanajam