Change functions checks, handle messages from ffmpeg, separate general functions