GPUImage3 icon indicating copy to clipboard operation
GPUImage3 copied to clipboard

MovieOutput outputs broken frame

Open b0o0d opened this issue 4 years ago • 0 comments

Hi, @BradLarson , thanks for all you have been done. I'm a totally heavy user of GPUImage1-3. Recently, I ran into a problem that had been mentioned before:

https://github.com/BradLarson/GPUImage3/issues/44#issuecomment-511658802

As long as you make some work in examples > iOS > SimpleVideoRecorder, you can find it easily.

  1. in ViewController, make fileURL global

  2. import Photos library and add following codes in the movieOutput?.finishRecording block:

           PHPhotoLibrary.shared().performChanges({() -> Void in
                 PHAssetChangeRequest.creationRequestForAssetFromVideo(atFileURL: self.fileURL)
           }, completionHandler: { _, error -> Void in
                 do {
                     // delete the caches.
                     try FileManager.default.removeItem(at: self.fileURL)
                 } catch {
                     print(error)
                 }
             })
    
  3. add "Privacy - Photo Library Usage Description" in info.plist.

Then play the output video in Photos app, broken frames randomly show on the screen (in my case, I'm using iPhone6S with iOS 13.3.1, but the same result on the case that I cast the textures from filter to CVPixelBuffer).

Any help would be appreciated. Tanks in advance.

b0o0d avatar Feb 26 '20 09:02 b0o0d