Added FFMPEG support and some bugfixies