Cleaned up AVEncoder which is working now, but we need to add an addAudioFrame() function to AVEncoderThreaded because the audio gets slightly out of sync after some minutes. A threaded encoder will fix this