Append/merge multiple video files into one final output video? #61

phil-m opened this Issue Apr 16, 2012 · 7 comments


None yet
6 participants

phil-m commented Apr 16, 2012

Hi, I've been experimenting with this great framework (thanks Brad/All for the amazing work!), & have recording with various filters saving to output files working.

I now need to merge a number of the already recorded videos into a final single composition. Is this possible with the current api?

As a test, I've tried to edit the SimpleVideoFileFilter example to play 2 video files (pre added to the project) one after the other, but can't find a way to hook into the end of the first one so I can start the second?

Does anyone have any pointers/ideas on how I could go about doing/adding this functionality?



BradLarson commented Apr 16, 2012

I don't know of an easy way to do this, because I try to preserve timestamps for video frames coming from movie sources, and the timestamps from two movies will overlap with one another. This wouldn't record well in the target video, so you couldn't combine videos just by feeding one in after another.

This would require some sort of mechanism for shifting one movie's timestamps to come after the other's. You're welcome to try adding this functionality, but I probably won't implement something like this for a while.


phil-m commented Apr 17, 2012

Thanks very much for the quick response Brad.

I can see the problem now, thanks for detailing the timestamp issue.

As I'm on a bit of a tight deadline, & am still learning my way though the GPUImage code base, I've opted to do this outside of GPUImage for now. Luckily for this project all the filters are applied to the individual video files, so the final comp only needs to merge them without any additional effects.

If anyone else requires this same feature for now, here's a couple of links that helped me get started with using AVMutableComposition & AVAssetExportSession to merge/compose multiple video files into a single final video:

Thanks again for your help & for your work on this library, its making image & video handling on iOS a joy!

Hi, phil-m, I want to have the same functionality but with network files, like the files will be streaming from network after one another and also I need to have seeking functionality in them so that if I seek through multiple files then that should be done properly.

Is it possible?

Here is a link I have got related to this, but I am not getting through


Hello all,
I'm trying to do the same thing but only with a little difference. I want to put one video on top of another with some chromakey effect. You can image like this, normally when doing chromakey, we replace the color (e.g. green) with a background picture. But this time I wanna replace it with a recording video. In this way, I could make sample movies with some clips. I tried to render a movie file on top of a video camera. But it doesn't work. Do you have any clue?


alariccole commented Jun 5, 2012

I think doing it outside of GPUImage is necessary, and I believe this is a feature outside of the scope of this project. I vote to close it.

You can find many mergers by Google Search:Movie Joiner| Best Video Combiner, VOB Merger, MKV Merger, MP4 Merger, AVI Merger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment