BradLarson / GPUImage2

GPUImage 2 is a BSD-licensed Swift framework for GPU-accelerated video and image processing.
BSD 3-Clause "New" or "Revised" License
4.87k stars 609 forks source link

MovieOutput is 1 second short saving to disk #193

Open skymook opened 7 years ago

skymook commented 7 years ago

Great library Brad. Love it. Thanks for your hard work.

I think I found a bug. I load a movie from the bundle, filter it, and I am saving the filtered movie to the documents folder on iOS. The flow looks like this:

MovieInput --> BasicOperation --> MovieOutput

It works great, but the resulting movie is about 1 second short.

When I use a RenderView as the output, the whole filtered movie displays to the end, including the last second.

MovieInput --> BasicOperation --> RenderView

Using a MovieOutput is about 1 second short. I think the problem lies in the MovieOutput.swift, and specially has something to do with assetWriter.movieFragmentInterval (which is 1 second). My guess is that the last chunk of movie output is not being processed for some reason.

It does this same thing on the simulator and the iPhone.