GPUImage icon indicating copy to clipboard operation
GPUImage copied to clipboard

Problem appending pixel buffer at time with SimpleVideoFileFilter

Open Thomasgeley opened this issue 13 years ago • 8 comments

Hello !

I have a problem with the sample SimpleVideoFileFilter, whenever I load the app, I always have the "Problem appending pixel buffer at time:" error. The error occurs on iPhone 5.1 and 6.1.4 devices, not on the simulator, where the buffers seem to append right until the app stop working without any error and the video file not finished.

I tried my own implementation of the code, with various filters, movie type and movie size, and the same error happens at different time.

Any leads on this issue ?

Thomasgeley avatar Jul 02 '13 11:07 Thomasgeley

It's a problem that I'm currently working on. It has to do with the audio encoding. If you disable the audio encoding in the video by commenting out the following lines:

movieWriter.shouldPassthroughAudio = YES;
movieFile.audioEncodingTarget = movieWriter;
[movieFile enableSynchronizedEncodingUsingMovieWriter:movieWriter];

the recording works fine. I think it might have to do with my newer performance improvements regarding the audio encoding queues in the movie writer.

I suspect that a bad timestamp is being used for the recording upon initialization here. Again, I'm currently investigating this.

BradLarson avatar Jul 02 '13 14:07 BradLarson

Thank you for your answer Brad. I'll give it a shot without the audio ASAP and will look into the latest audio encoding changes to see if I can help.

Regards

Thomasgeley avatar Jul 02 '13 14:07 Thomasgeley

+1 on this. Also, is there a branch to roll back to that doesn't introduce the new audio stuff? I have something I'm about to release to production but this issue cropped up with the latest version.

drewmca avatar Jul 02 '13 21:07 drewmca

I believe this is the commit before I made those changes: https://github.com/BradLarson/GPUImage/commit/a29f15a72528e152892f6245abb2f37271fa5a70 . This is the one where I started reworking the encoding queues to boost recording performance: https://github.com/BradLarson/GPUImage/commit/6c785e4c0275b037c6bcf0f4d8dab59c3601c872

BradLarson avatar Jul 02 '13 21:07 BradLarson

I believe this is now fixed with the latest code in the repository.

BradLarson avatar Jul 19 '13 03:07 BradLarson

Hi, I'm still getting this error trying to write a movie with audio. This is with today's latest framework. At assetWriterPixelBufferInput appendPixelBuffer, the assetWriter's error property is:

Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo=0x14510400 {NSLocalizedDescription=The operation could not be completed, NSUnderlyingError=0x1466ae00 "The operation couldn’t be completed. (OSStatus error -12738.)", NSLocalizedFailureReason=An unknown error occurred (-12738)}

The error 11800 is "unknown error", not very helpful. Of course as you said, without audio, it works flawlessly.

plenilune avatar Aug 28 '13 10:08 plenilune

Update: by not invalidating the sample buffer as described here https://github.com/BradLarson/GPUImage/pull/1070 I was able to process audio without issue.

plenilune avatar Aug 29 '13 01:08 plenilune

While Problem appending pixel buffer at time error log doesn't appear if you are using default video type AVFileTypeQuickTimeMovie, it appear more often when you are using AVFileTypeMPEG4 Can anyone help me to solve this limitation?

petershine avatar Apr 07 '14 07:04 petershine