Better performance in encodingThread but some lag

compressions frommm 2.7MB to 800kb per frame.