Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
video overlay from camera + audio #1413
We've been using GPUImage a lot lately, mainly for editing camera input on the fly. Everything seems to be working pretty fine, but seems like we've hit these timing issues you mentioned in #1246 when blending input with another video. For example, shooting a 22s video will leave us with videos of ridiculous lengths, like 16hs, usually with no audio. But shooting shorter videos will output video and audio, even though length is still inappropriate.
Thanks for such a great framework :)
The core problems come from the GPUImageTwoInputFilter, which the blends are subclassed from. Both movie sources provide their own timestamps for each frame that's passed in, but I'm not sure that I'm keeping these timestamps straight or in sync. Timestamps are passed down the filter chain and then used for the timestamps on recording in the movie writer, but keeping them in a consistent order and based on some synchronized time value isn't managed well.
This is what triggers all the bizarre behavior people see around blending two movies together (something I never designed things for, and now need to find a way to fix). It's a tricky problem, and I don't spend a lot of time working with movie files, so it's not one of the areas I've put a lot of thought into.