Port the HTTP / RTSP encoder and decoder from 4.0 branch as those are just faster.