code: def download_ffmpeg_binaries(path, os_windows=False, os_bit=""):
      """
      ## download_ffmpeg_binaries
  
      Generates FFmpeg Static Binaries for windows(if not available)
  
      Parameters:
          path (string): path for downloading custom FFmpeg executables
          os_windows (boolean): is running on Windows OS?
          os_bit (string): 32-bit or 64-bit OS?
  
      **Returns:** A valid FFmpeg executable path string.
      """
      final_path = ""
      if os_windows and os_bit:
          # initialize with available FFmpeg Static Binaries GitHub Server
          file_url = "https://github.com/abhiTronix/FFmpeg-Builds/releases/latest/download/ffmpeg-static-{}-gpl.zip".format(
              os_bit
          )
  
          file_name = os.path.join(
              os.path.abspath(path),
              "ffmpeg-static-{}-gpl.zip".format(os_bit),
          )
          file_path = os.path.join(
              os.path.abspath(path),
              "ffmpeg-static-{}-gpl/bin/ffmpeg.exe".format(os_bit),
          )
          base_path, _ = os.path.split(
              file_name
          )  # extract file base path
          # check if file already exists
          if os.path.isfile(file_path):
              final_path += file_path  # skip download if does
          else:
              # import libs
              import zipfile
  
              # check if given path has write access
              assert os.access(path, os.W_OK), (
                  "[Helper:ERROR] :: Permission Denied, Cannot write binaries to directory = "
                  + path
              )
              # remove leftovers if exists
              os.path.isfile(file_name) and delete_file_safe(file_name)
              # download and write file to the given path
              with open(file_name, "wb") as f:
                  logger.debug(
                      "No Custom FFmpeg path provided. Auto-Installing FFmpeg static binaries from GitHub Mirror now. Please wait..."
                  )
                  # create session
                  with requests.Session() as http:
                      # setup retry strategy
                      retries = Retry(
                          total=3,
                          backoff_factor=1,
                          status_forcelist=[429, 500, 502, 503, 504],
                      )
                      # Mount it for https usage
                      adapter = TimeoutHTTPAdapter(
                          timeout=2.0, max_retries=retries
                      )
                      http.mount("https://", adapter)
                      response = http.get(file_url, stream=True)
                      response.raise_for_status()
                      total_length = (
                          response.headers.get("content-length")
                          if "content-length" in response.headers
                          else len(response.content)
                      )
                      assert not (
                          total_length is None
                      ), "[Helper:ERROR] :: Failed to retrieve files, check your Internet connectivity!"
                      bar = tqdm(
                          total=int(total_length),
                          unit="B",
                          unit_scale=True,
                      )
                      for data in response.iter_content(
                          chunk_size=4096
                      ):
                          f.write(data)
                          len(data) > 0 and bar.update(len(data))
                      bar.close()
              logger.debug("Extracting executables.")
              with zipfile.ZipFile(file_name, "r") as zip_ref:
                  zip_fname, _ = os.path.split(
                      zip_ref.infolist()[0].filename
                  )
                  zip_ref.extractall(base_path)
              # perform cleaning
              delete_file_safe(file_name)
              logger.debug(
                  "FFmpeg binaries for Windows configured successfully!"
              )
              final_path += file_path
      # return final path
      return final_path
  
imports: import os
  import re
  import sys
  import cv2
  import types
  import errno
  import stat
  import shutil
  import importlib
  import requests
  import numpy
  import logging
  import platform
  import socket
  from tqdm import tqdm
  from contextlib import closing
  from pathlib import Path
  from colorlog import ColoredFormatter
  from pkg_resources import parse_version
  from requests.adapters import HTTPAdapter, Retry
  from ..version import __version__
label_desc: Use image node_id 29 for calling a global function with example usage: download_ffmpeg_binaries(path, os_windows, os_bit) and returns: final_path