static parseCmdLine(argv) {
    const simulationYargs = yargs
      .option('detections', {
        requiresArg: true,
      })
      .alias('detections', 'yolo_json')
      .option('video_file_or_folder', {
        requiresArg: true,
        default: '',
      })
      .option('isLive', {
        type: 'boolean',
        default: true,
      })
      .option('jsonFps', {
        type: 'number',
        requiresArg: true,
        default: 20,
      })
      .option('mjpgFps', {
        type: 'number',
        requiresArg: true,
        default: 20,
      })
      .option('darknetStdout', {
        type: 'boolean',
        default: true,
      })
      .option('json_port', {
        type: 'number',
        requiresArg: true,
        default: 8070,
      })
      .option('mjpeg_port', {
        type: 'number',
        requiresArg: true,
        default: 8090,
      })
      .demandOption('detections')
      .fail((msg, err, yYargs) => {
        const errMsg = msg + os.EOL + os.EOL + yYargs.help();
        throw new Error(errMsg);
      });

    // In order to take the JSON and MJPG port from the command line we need to add a '-' since
    // original darknet arguments use '-', but yargs needs '--'
    const argsvSane = [];
    argv.forEach((x) => {
      if (x === '-json_port' || x === '-mjpeg_port') {
        argsvSane.push(`-${x}`);
        return;
      }

      if (typeof x === 'string' && x.startsWith('--') && x.indexOf(' ') >= 0) {
        splitargs(x).forEach((s) => {
          argsvSane.push(s);
        });
        return;
      }

      argsvSane.push(x);
    });
    const simulationArgv = simulationYargs.parse(argsvSane);

    return {
      videoParams: {
        detections: simulationArgv.detections,
        video_file_or_folder: simulationArgv.video_file_or_folder,
        isLive: simulationArgv.isLive,
        jsonFps: simulationArgv.jsonFps,
        mjpgFps: simulationArgv.mjpgFps,
      },
      jsonStreamPort: simulationArgv.json_port,
      mjpegStreamPort: simulationArgv.mjpeg_port,
      darknetStdout: simulationArgv.darknetStdout,
    };
  }
Parses the command line to create a config object

@param {*} argv String[] of the command line arguments

@returns A command line object

@throws Error if parsing failed