Filtering video with GPUImage

后端 未结 2 1406
醉梦人生
醉梦人生 2021-01-24 02:33

I\'m using GPUImage in my application and trying to filter video. Live video filtering is working well. The trouble comes up when I try to read a video into memory from the file

2条回答
  •  囚心锁ツ
    2021-01-24 02:51

    There's at least one thing here that might be behind this. In the code above, you're not hanging on to a strong reference to your movieFile source object.

    If this is an ARC-enabled project, that object will be deallocated the instant that you complete your setup method (if it's not, you'll be leaking that object). That will stop movie playback, deallocate the movie itself, and lead to black frames being sent down the filter pipeline (other potential instabilities).

    You need to make movieFile a strongly-referenced instance variable to make sure it hangs on past this setup method, since all movie processing is asynchronous.

提交回复
热议问题