GPUImage icon indicating copy to clipboard operation
GPUImage copied to clipboard

GPUImageMovieWriter doesn't work with GPUImageTextureInput in cubeTest example(How to provide appropriate timestamps ?)

Open sjtujulian opened this issue 11 years ago • 0 comments

Hi, brad I need to record the video using GPUImageMovieWriter from GPUImageTextureInput in your cubeTest (or project has a similar structure of cubetest : ES2Render+ GPUImageTextureInput). But the problem is the movie writer doesn't work recording video from GPUImageTextureInput in this structure, maybe it is caused by having no appropriate timestamps (referred to your answer http://stackoverflow.com/questions/14624877/record-opengl-view-with-gpuimagemoviewriter).

I implement it like the following (according to your simpleVideoFilter example)

movieWriter.encodingLiveVideo = YES; [filter addTarget:movieWriter]; renderer->stillCamera.audioEncodingTarget = movieWriter; [movieWriter startRecording]; [filter removeTarget:movieWriter]; renderer->stillCamera.audioEncodingTarget = nil; [movieWriter finishRecording]; Here, filter is defined in viewcontroller.m not ES2render.m

However, the result is always wrong. I am confused by the fact that if I replace filter by renderer->bilateralFilter(defined in ES2render.m), it works. I wonder if I need to provide a appropriate timestamps. If so, how can I get it ? By overriding - (void)newFrameReadyAtTime:(CMTime)frameTime atIndex:(NSInteger)textureIndex; ?

Can you kindly provide me some ideas about this issue?

sjtujulian avatar Jul 03 '15 08:07 sjtujulian