code: def get_ffmpeg_lib_versions(ffmpeg_path=None):
    
    r = collections.OrderedDict()
    cmd = (ffmpeg_path or "ffmpeg", "-version")
    output = subprocess.run(cmd,
                            check=True,
                            stdout=subprocess.PIPE,
                            universal_newlines=True).stdout
    output = output.splitlines()
    lib_version_regex = re.compile("^\s*(lib[a-z]+)\s+([0-9]+).\s*([0-9]+).\s*([0-9]+)\s+")
    for line in output:
      match = lib_version_regex.search(line)
      if match:
        lib_name, *lib_version = match.group(1, 2, 3, 4)
        int_lib_version = 0
        for i, d in enumerate(map(int, reversed(lib_version)), 1):
          int_lib_version |= d << (8 * i)
        r[lib_name] = int_lib_version
    return r
docs: Get FFmpeg library versions as 32 bit integers, with same format as sys.hexversion.
  
    Example: 0x3040100 for FFmpeg 3.4.1