code: def video2frames(video_path, outpath, **kargs):
      def _dict2str(kargs):
          cmd_str = ""
          for k, v in kargs.items():
              cmd_str += " " + str(k) + " " + str(v)
          return cmd_str
  
      ffmpeg = ["ffmpeg ", " -y -loglevel ", " error "]
      vid_name = video_path.split("/")[-1].split(".")[0]
      out_full_path = os.path.join(outpath, vid_name)
  
      if not os.path.exists(out_full_path):
          os.makedirs(out_full_path)
  
      # video file name
      outformat = out_full_path + "/%08d.png"
  
      cmd = ffmpeg
      cmd = ffmpeg + [
          " -i ",
          video_path,
          " -start_number ",
          " 0 ",
          outformat,
      ]
  
      cmd = "".join(cmd) + _dict2str(kargs)
  
      if os.system(cmd) != 0:
          raise RuntimeError(
              "ffmpeg process video: {} error".format(vid_name)
          )
  
      sys.stdout.flush()
      return out_full_path
  
imports: import base64
  import os
  import sys
  import cv2
  import numpy
  import paddle
  import paddle.nn
  from PIL import Image
label_desc: Use image node_id 10 for calling a global function with example usage: video2frames(video_path, outpath) and returns: out_full_path, cmd_str