def upload_video()

in contentannotation/video2annotation.py [0:0]


    def upload_video(self, file_path: str) -> Dict[str, Any]:
        print(f"Uploading file... {file_path}")
        try:
            video_file = genai.upload_file(path=file_path)

            while video_file.state.name == "PROCESSING":
                time.sleep(10)
                video_file = genai.get_file(video_file.name)

            if video_file.state.name == "FAILED":
                return {"error": "Upload failed", "video_file": None}
            return {"video_file": video_file}
        
        except Exception as e:
            return {"error": str(e), "video_file": None}