function encodeAmf0Cmd(opt) {
  let data = amf0EncodeOne(opt.cmd);

  if (rtmpCmdCode[opt.cmd]) {
    rtmpCmdCode[opt.cmd].forEach(function (n) {
      if (Object.prototype.hasOwnProperty.call(opt, n))
        data = Buffer.concat([data, amf0EncodeOne(opt[n])]);
    });
  } else {
    logger.error("Unknown command", opt);
  }
  // logger.debug('Encoded as',data.toString('hex'));
  return data;
}
Encode AMF0 Command
@param {object} opt
@returns {*}