BradLarson / GPUImage

An open source iOS framework for GPU-based image and video processing
http://www.sunsetlakesoftware.com/2012/02/12/introducing-gpuimage-framework
BSD 3-Clause "New" or "Revised" License
20.2k stars 4.61k forks source link

GPUImage reads ITU_R_601_4 format video with no supportsFastTextureUpload resulted in teared image buffer #2622

Open kobunketsu opened 5 years ago

kobunketsu commented 5 years ago

My project is using GPUImage framework to process videos. Because I am using multiple frame-buffers to process image, I found GPUImageContext supportsFastTextureUpload consumes much more memory than not using it. (In 720p 15s video, supportsFastTextureUpload consumes up to 500M vs off only 200M).

So I set supportsFastTextureUpload to false in my project.But this leads to another problem. It can't handle different video formats properly.

Asset track with CVImageBufferYCbCrMatrix ITU_R_709_2 is OK.

Asset track with CVImageBufferYCbCrMatrix ITU_R_601_4 --> the result image tears.

Asset track with formatName 'avc1' --> the result image tears.

supportsFastTextureUpload can handle them correctly, but I can not avoid the memory pressure.

Why supportsFastTextureUpload=false can't not read different video frame correctly?

Or how can I solve the memory issue of supportsFastTextureUpload=true.