class_docstr: Finite state ffmpeg `-i` command option file information parser.
  Is designed to parse the output fast, in one loop. Iterates line by
  line of the `ffmpeg -i <filename> [-f null -]` command output changing
  the internal state of the parser.
  
  Parameters
  ----------
  
  filename
    Name of the file parsed, only used to raise accurate error messages.
  
  infos
    Information returned by FFmpeg.
  
  fps_source
    Indicates what source data will be preferably used to retrieve fps data.
  
  check_duration
    Enable or disable the parsing of the duration of the file. Useful to
    skip the duration check, for example, for images.
  
  decode_file
    Indicates if the whole file has been decoded. The duration parsing strategy
    will differ depending on this argument.
class_docstr_tok: ["Finite","state","ffmpeg","`","-i","`","command","option","file","information","parser",".","Is","designed","to","parse","the","output","fast",",","in","one","loop",".","Iterates","line","by","line","of","the","`","ffmpeg","-i","<","filename",">","[","-f","null","-","]","`","command","output","changing","the","internal","state","of","the","parser",".","Parameters","--","--","--","--","--","filename","Name","of","the","file","parsed",",","only","used","to","raise","accurate","error","messages",".","infos","Information","returned","by","FFmpeg",".","fps_source","Indicates","what","source","data","will","be","preferably","used","to","retrieve","fps","data",".","check_duration","Enable","or","disable","the","parsing","of","the","duration","of","the","file",".","Useful","to","skip","the","duration","check",",","for","example",",","for","images",".","decode_file","Indicates","if","the","whole","file","has","been","decoded",".","The","duration","parsing","strategy","will","differ","depending","on","this","argument","."]
docstr: Parses data from "Stream ... Video" line.
docstr_tok: ["Parses","data","from","``","Stream","...","Video","''","line","."]
code: def parse_video_stream_data(self, line):
      """Parses data from "Stream ... Video" line."""
      global_data, stream_data = ({"video_found": True}, {})
  
      try:
          match_video_size = re.search(r" (\d+)x(\d+)[,\s]", line)
          if match_video_size:
              # size, of the form 460x320 (w x h)
              stream_data["size"] = [
                  int(num) for num in match_video_size.groups()
              ]
      except Exception:
          raise IOError(
              (
                  "MoviePy error: failed to read video dimensions in"
                  " file '%s'.\nHere are the file infos returned by"
                  "ffmpeg:\n\n%s"
              )
              % (self.filename, self.infos)
          )
  
      match_bitrate = re.search(r"(\d+) kb/s", line)
      stream_data["bitrate"] = (
          int(match_bitrate.group(1)) if match_bitrate else None
      )
  
      # Get the frame rate. Sometimes it's 'tbr', sometimes 'fps', sometimes
      # tbc, and sometimes tbc/2...
      # Current policy: Trust fps first, then tbr unless fps_source is
      # specified as 'tbr' in which case try tbr then fps
  
      # If result is near from x*1000/1001 where x is 23,24,25,50,
      # replace by x*1000/1001 (very common case for the fps).
  
      if self.fps_source == "fps":
          try:
              fps = self.parse_fps(line)
          except (AttributeError, ValueError):
              fps = self.parse_tbr(line)
      elif self.fps_source == "tbr":
          try:
              fps = self.parse_tbr(line)
          except (AttributeError, ValueError):
              fps = self.parse_fps(line)
      else:
          raise ValueError(
              ("fps source '%s' not supported parsing the video '%s'")
              % (self.fps_source, self.filename)
          )
  
      # It is known that a fps of 24 is often written as 24000/1001
      # but then ffmpeg nicely rounds it to 23.98, which we hate.
      coef = 1000.0 / 1001.0
      for x in [23, 24, 25, 30, 50]:
          if (fps != x) and abs(fps - x * coef) < 0.01:
              fps = x * coef
      stream_data["fps"] = fps
  
      if (
          self._current_stream["default"]
          or "video_size" not in self.result
      ):
          global_data["video_size"] = stream_data.get("size", None)
      if (
          self._current_stream["default"]
          or "video_bitrate" not in self.result
      ):
          global_data["video_bitrate"] = stream_data.get(
              "bitrate", None
          )
      if (
          self._current_stream["default"]
          or "video_fps" not in self.result
      ):
          global_data["video_fps"] = stream_data["fps"]
  
      return (global_data, stream_data)
  
imports: import os
  import re
  import subprocess
  import warnings
  import numpy
  from moviepy.config import FFMPEG_BINARY
  from moviepy.tools import convert_to_seconds, cross_platform_popen_params
label_desc: Use image node_id 6 for calling the FFmpegInfosParser obj's underlying member method code with example usage: obj.parse_video_stream_data(line) and returns: global_data,  stream_data