Added generic filter function applying a function to every frame.