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

Having a delegate can lead to black video output #63

Open
gsabran opened this issue Jan 15, 2017 · 5 comments
Open

Having a delegate can lead to black video output #63

gsabran opened this issue Jan 15, 2017 · 5 comments

Comments

@gsabran
Copy link
Contributor

gsabran commented Jan 15, 2017

I don't understand the reason well, but setting a delegate can lead to the result being black. I've noticed that having a delegate leads to extra things being run: https://github.com/rs/SDAVAssetExportSession/blob/master/SDAVAssetExportSession.m#L243-L254

so that's probably creating the issue, even though I'm not sure how

@joshbax
Copy link

joshbax commented Jan 26, 2017

I believe it's because the delegate uses a AVAssetWriterInputPixelBufferAdaptor with hardcoded attributes. Try modifying these lines. On iOS, this might work: (id)kCVPixelBufferPixelFormatTypeKey : @(kCVPixelFormatType_420YpCbCr8BiPlanarFullRange)

@shahen94
Copy link

shahen94 commented Mar 1, 2017

@joshbax i tried your suggestion, it doesn't fix the issue

@sjmueller
Copy link

We are experiencing this as well. Happens about every 6-8 videos. Any other suggestions?

@sjmueller
Copy link

sjmueller commented Jul 20, 2017

A bit more info, it's actually not an intermittent problem as I previously thought. For us, the front camera works fine, but the back camera always renders black. If you look closely, our videos have a 1 pixel vertical line in which you see part of the video playing while the rest is black. Audio works fine.

We tried @joshbax suggestion, and also tried changes made in this PR: https://github.com/rs/SDAVAssetExportSession/pull/58/files#diff-31ccfacb15a054f36d2e5b7b1d4ec6d2R137

Unfortunately, nothing worked and we haven't found a solution yet.

@gsabran
Copy link
Contributor Author

gsabran commented Jul 21, 2017

I personally ended up changing the delegate to just be exportSession:renderFrame:withPresentationTime: ie ditching the buffer property and its computation that was causing the issue since I didn't need it

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