Forcing script to wait for ffmpeg to finish