code: public void init() {
          // decoder is ok for sharing between rtmpt connections
          decoder = new RTMPTProtocolDecoder();
          encoder = new ThreadLocal<RTMPTProtocolEncoder>() {
              protected RTMPTProtocolEncoder initialValue() {
                  RTMPTProtocolEncoder enc = new RTMPTProtocolEncoder();
                  enc.setBaseTolerance(baseTolerance);
                  enc.setDropLiveFuture(dropLiveFuture);
                  return enc;
              }
          };
      }
docs: Initialization