docs: def _second_pass(self):
          """
          Construct the second pass command and run it
  
          FIXME: make this method simpler
          """
          logger.info("Running second pass for {}".format(self.input_file))
  
          # get the target output stream types depending on the options
          output_stream_types = ['audio']
          if not self.ffmpeg_normalize.video_disable:
              output_stream_types.append('video')
          if not self.ffmpeg_normalize.subtitle_disable:
              output_stream_types.append('subtitle')
  
          # get complex filter command
          audio_filter_cmd, output_labels = self._get_audio_filter_cmd()
  
          # base command, here we will add all other options
          cmd = [
              self.ffmpeg_normalize.ffmpeg_exe, '-y', '-nostdin', '-i', self.input_file,
              '-filter_complex', audio_filter_cmd
          ]
  
          # map metadata, only if needed
          if self.ffmpeg_normalize.metadata_disable:
              cmd.extend(['-map_metadata', '-1'])
          else:
              # map global metadata
              cmd.extend(['-map_metadata', '0'])
              # map per-stream metadata (e.g. language tags)
              for stream_type in output_stream_types:
                  stream_key = stream_type[0]
                  if stream_type not in self.streams:
                      continue
                  for idx, _ in enumerate(self.streams[stream_type].items()):
                      cmd.extend([
                          '-map_metadata:s:{}:{}'.format(stream_key, idx),
                          '0:s:{}:{}'.format(stream_key, idx)
                      ])
  
          # map chapters if needed
          if self.ffmpeg_normalize.chapters_disable:
              cmd.extend(['-map_chapters', '-1'])
          else:
              cmd.extend(['-map_chapters', '0'])
  
          # collect all '-map' and codecs needed for output video based on input video
          if not self.ffmpeg_normalize.video_disable:
              for s in self.streams['video'].keys():
                  cmd.extend(['-map', '0:{}'.format(s)])
              # set codec (copy by default)
              cmd.extend(['-c:v', self.ffmpeg_normalize.video_codec])
  
          # ... and map the output of the normalization filters
          for ol in output_labels:
              cmd.extend(['-map', ol])
  
          # set audio codec (never copy)
          if self.ffmpeg_normalize.audio_codec:
              cmd.extend(['-c:a', self.ffmpeg_normalize.audio_codec])
          else:
              for index, (_, audio_stream) in enumerate(self.streams['audio'].items()):
                  cmd.extend(['-c:a:{}'.format(index), audio_stream.get_pcm_codec()])
  
          # other audio options (if any)
          if self.ffmpeg_normalize.audio_bitrate:
              cmd.extend(['-b:a', str(self.ffmpeg_normalize.audio_bitrate)])
          if self.ffmpeg_normalize.sample_rate:
              cmd.extend(['-ar', str(self.ffmpeg_normalize.sample_rate)])
  
          # ... and subtitles
          if not self.ffmpeg_normalize.subtitle_disable:
              for s in self.streams['subtitle'].keys():
                  cmd.extend(['-map', '0:{}'.format(s)])
              # copy subtitles
              cmd.extend(['-c:s', 'copy'])
  
          if self.ffmpeg_normalize.keep_original_audio:
              highest_index = len(self.streams['audio'])
              for index, (_, s) in enumerate(self.streams['audio'].items()):
                  cmd.extend(['-map', '0:a:{}'.format(index)])
                  cmd.extend(['-c:a:{}'.format(highest_index + index), 'copy'])
  
          # extra options (if any)
          if self.ffmpeg_normalize.extra_output_options:
              cmd.extend(self.ffmpeg_normalize.extra_output_options)
  
          # output format (if any)
          if self.ffmpeg_normalize.output_format:
              cmd.extend(['-f', self.ffmpeg_normalize.output_format])
  
          # if dry run, only show sample command
          if self.ffmpeg_normalize.dry_run:
              cmd.append(self.output_file)
              cmd_runner = CommandRunner(cmd, dry=True)
              cmd_runner.run_command()
              yield 100
              return
  
          # create a temporary output file name
          temp_dir = tempfile.gettempdir()
          output_file_suffix = os.path.splitext(self.output_file)[1]
          temp_file_name = os.path.join(
              temp_dir,
              next(tempfile._get_candidate_names()) + output_file_suffix
          )
          cmd.append(temp_file_name)
  
          # run the actual command
          try:
              cmd_runner = CommandRunner(cmd)
              for progress in cmd_runner.run_ffmpeg_command():
                  yield progress
  
              # move file from TMP to output file
              logger.debug(
                  "Moving temporary file from {} to {}"
                  .format(temp_file_name, self.output_file)
              )
              shutil.move(temp_file_name, self.output_file)
          except Exception as e:
              logger.error("Error while running command {}!".format(cmd))
              # remove dangling temporary file
              if os.path.isfile(temp_file_name):
                  os.remove(temp_file_name)
              raise e
  
          logger.debug("Normalization finished")