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

Resolve errors #93

Closed
wants to merge 8 commits into from
Closed

Resolve errors #93

wants to merge 8 commits into from

Conversation

digitallysavvy
Copy link

Appending directly to AVAssetWriterInputPixelBufferAdaptor using:

func append(pixel buffer:CVPixelBuffer, with time: CMTime) {
        pixelBufferInput.append(buffer, withPresentationTime: time)
}

was causing the writer to fail unexpectedly after writing the first frame. By using a PixelBufferPool the writer runs without issue.

func append(pixel buffer:CVPixelBuffer, with time: CMTime) {
        var appendSucceeded = false
        autoreleasepool {
            if let _ = pixelBufferInput.pixelBufferPool {
                appendSucceeded = pixelBufferInput.append(
                    buffer,
                    withPresentationTime: time
                )
            }
        }
        logAR.message("append to pixel buffer: \(appendSucceeded)")
    }

after resolving buffer pool, pixel format started causing writer to fail, so updated sourcePixelBufferAttributes to:

let attributes : [String:Any] = [
        kCVPixelBufferPixelFormatTypeKey as String: Int(kCVPixelFormatType_32ARGB),
        kCVPixelBufferCGImageCompatibilityKey as String : true,
        kCVPixelBufferCGBitmapContextCompatibilityKey as String : true
]

Other:
Latest version of Xcode was throwing errors and warning for renamed enums, types, etc. Resolved all errors and warnings. Builds for iOS 12 (hopefully this resolves #92)

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

Successfully merging this pull request may close these issues.

One of the greatest framework but has so much errors and no support
1 participant