Move vframes flag after input and change Subprocess from wait to communicate