Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

readyForMoreMediaData crash #1

Open
UtkuDalmaz opened this issue Mar 17, 2020 · 5 comments
Open

readyForMoreMediaData crash #1

UtkuDalmaz opened this issue Mar 17, 2020 · 5 comments

Comments

@UtkuDalmaz
Copy link

Cannot append sample buffer: readyForMoreMediaData is NO

@manucodin
Copy link

  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.

@malonehedges
Copy link

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

@manucodin
Copy link

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

@malonehedges
Copy link

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

@Razanajam
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants