Added the AVEncoderThreaded to do encoding in a separate thread