def METHOD_NAME(spec: benchmark_spec.BenchmarkSpec) -> List[sample.Sample]:
  """Runs multiple Ffmpeg processes concurrently using GNU parallel.
  Args:
    spec: The benchmark specification.
  Returns:
    samples: A list of samples including total time to transcode.
  """
  vm = spec.vms[0]
  samples = []
  input_videos_dir = '/scratch/vbench/videos/crf0'
  for codec in _FFMPEG_CODECS.value:
    jobs_list = (
        _FFMPEG_PARALLELISM_LIST.value
        if _FFMPEG_PARALLELISM_LIST else [vm.NumCpusForBenchmark()])
    if codec == CODEC_H264:
      ffmpeg_args = '-c:v libx264 -preset medium -crf 18'
      threads_list = (
          _FFMPEG_THREADS_LIST.value
          if _FFMPEG_THREADS_LIST else DEFAULT_H264_THREADS_LIST)
    elif codec == CODEC_VP9:
      # A single VP9 ffmpeg thread almost saturates a CPU core. Increasing the
      # parallelism is counterproductive on all machines benchmarked so far.
      ffmpeg_args = '-c:v libvpx-vp9 -crf 10 -b:v 0 -quality good'
      threads_list = (
          _FFMPEG_THREADS_LIST.value
          if _FFMPEG_THREADS_LIST else DEFAULT_VP9_THREADS_LIST)
    for jobs, threads in itertools.product(jobs_list, threads_list):
      jobs_arg = f'-j{jobs}'
      threads_arg = f'-threads {threads} '
      parallel_cmd = (f'parallel {jobs_arg} {_FFMPEG_DIR.value}/ffmpeg '
                      f'{threads_arg} -y -i {{}} {ffmpeg_args} '
                      f'{{.}}.out.mkv </dev/null >&/dev/null ::: *.mkv')
      time_file = '~/parallel.time'
      run_cmd = (
          f'cd {input_videos_dir} && /usr/bin/time -f "%e" -o {time_file} '
          f'{parallel_cmd}')
      vm.RemoteCommand(run_cmd)
      total_runtime, _ = vm.RemoteCommand(
          ('awk \'{sum+=$1;} END {print sum}\' '
           f'{time_file}'))
      logging.info('Total runtime with %s jobs and %s threads: %s', jobs,
                   threads, total_runtime)
      vm.RemoteCommand(f'cd {input_videos_dir} && rm -rf *.out.mkv')
      samples.extend([
          sample.Sample(
              'Total Transcode Time',
              total_runtime,
              'seconds',
              metadata={
                  'test': 'upload',
                  'codec': codec,
                  'num_files': 15,  # TODO(spencerkim): Count *.out* files.
                  'parallelism': jobs,
                  'threads': threads,
                  'ffmpeg_compiled_from_source':
                      FLAGS.build_ffmpeg_from_source,
                  'video_copies': 1,
              })
      ])
  return samples