GPUImageMovie -> GPUImageMovieWriter audio sync and notification problem #830

Open
CDNIronman opened this Issue Feb 9, 2013 · 0 comments

Comments

Projects
None yet
1 participant
@CDNIronman

My app is built with the latest GPUImage framework and Xcode 4.6, the latest iOS SDK and a target of iOS6.0. I build the GPUImage framework with a target of iOS5.1.

When I try to process a video file using GPUMovie -> GPUImageFilter -> GPUImageMovieWriter, often the last two pixelBuffers in the file throw an error, usually after an empty audio buffer is received.

When this happens, no didCompleteplayingMovie notification is generated at the end of file processing by GPUImageMovie, and no movieRecordingCompleted notification is generated at the end of file processing by GPUImageMovieWriter.

The problem only occurs if I have an audio track that is being synced while processing. Disregarding the audio eliminates the issue. When the audio is synced, at the time of the two pixel buffer errors near the end of the file, the audio buffers received have time=0 and timescale =0 but audio is still processing.

The issue does not occur for videos shot from the native camera app, only for videos shot with GPUImageMovieVideoCamera -> GPUImageFilter -> GPUImageMovieWriter within my app. These videos present and play properly outside my app in the native Photos app.

Here is what happens at the end of reading the file...
GPUImageMovie processAudioBuffer...
Recorded audio sample time: 0, 0, 0
GPUImageMovie readNextVideoFrameFromOutput for _playAtActualSpeed...
GPUImageMovie processMovieFrame...
Problem appending pixel buffer at time: 2883, 600, 0
Current frame time : 74.979961 ms
GPUImageMovie readNextVideoFrameFromOutput for _playAtActualSpeed...
GPUImageMovie processMovieFrame...
Problem appending pixel buffer at time: 2923, 600, 0
Current frame time : 58.836997 ms
GPUImageMovie processAudioBuffer...
Recorded audio sample time: 0, 0, 0

Then nothing... the movie has finished reading and writing but notifications are not generated. If I force the file to close at this point and play the recording, the video freezes one or two seconds early, and the audio plays to the end of the saved file.

@CDNIronman CDNIronman closed this Apr 18, 2013

@CDNIronman CDNIronman reopened this Apr 18, 2013

@tuo tuo referenced this issue Feb 5, 2015

Closed

Fix movie writer #1913

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment