Needs comment explaining what it does. Is it to collect small pieces into larger frames, before passing them into ffmpeg?