while (cnt->finish || cnt->makemovie) {
. This does not fit our needs(cannot be GStreamer chain): you need to return control after each frame is processed. We can write a new motion_chain function that the motion executable calls in a while statement. This is exactly the part that should be in a GStreamer chain function... Everything before while
should either be in the init functions or in the main program that sets up the gstreamer chain.