Real-time bi-directional video encoding and decoding for iOS