{"record":{"id":"38a3fe1acd77eb2b","repo":"BerriAI/litellm","slug":"no-base64-encoded-video-data-found","errorCode":null,"errorMessage":"No base64 encoded video data found","messagePattern":"No base64 encoded video data found","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/vertex_ai/videos/transformation.py","lineNumber":563,"sourceCode":"\n        if not response_data.get(\"done\", False):\n            raise ValueError(\n                \"Video generation is not complete yet. Please check status with video_status() before downloading.\"\n            )\n\n        try:\n            video_response: Final = response_data.get(\"response\", {})\n            videos: Final = video_response.get(\"videos\", [])\n\n            if not videos or len(videos) == 0:\n                raise ValueError(\"No video data found in completed operation\")\n\n            # Get the first video\n            video_data: Final = videos[0]\n            base64_encoded: Final = video_data.get(\"bytesBase64Encoded\")\n\n            if not base64_encoded:\n                raise ValueError(\"No base64 encoded video data found\")\n\n            # Decode base64 to bytes\n            video_bytes: Final = base64.b64decode(base64_encoded)\n            return video_bytes\n\n        except (KeyError, IndexError) as e:\n            raise ValueError(f\"Failed to extract video data: {e}\")\n\n    def transform_video_remix_request(\n        self,\n        video_id: str,\n        prompt: str,\n        api_base: str,\n        litellm_params: GenericLiteLLMParams,\n        headers: dict,\n        extra_body: dict[str, object] | None = None,\n    ) -> tuple[str, dict]:\n        \"\"\"","sourceCodeStart":545,"sourceCodeEnd":581,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/vertex_ai/videos/transformation.py#L545-L581","documentation":"The deepest extraction step of the Veo download transformer: the videos array exists and the first element was read, but it has no `bytesBase64Encoded` field, so there is nothing to base64-decode into video bytes. Like the empty-videos case, this means the operation completed but returned a video entry in an unexpected shape — commonly a GCS reference (gcsUri) instead of inline base64, or a filtered/empty entry.","triggerScenarios":"A completed Veo operation whose videos[0] contains {\"gcsUri\": \"gs://...\"} or an error note instead of inline base64 data; large videos where Vertex stores output in GCS rather than embedding bytes.","commonSituations":"Long/high-resolution generations exceeding the inline-payload size so results land in GCS; model/region variants with GCS-only responses; safety-filtered entries with no payload.","solutions":["Inspect videos[0] (log the status response) — if it carries gcsUri, download from GCS directly (gsutil/storage client) using your project credentials.","Retry with shorter durations or lower resolution to get inline base64 payloads.","Re-run the generation if the entry looks filtered/empty (no gcsUri either) after adjusting the prompt.","Upgrade litellm — newer builds handle gcsUri-style Veo responses."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":"def video_entry_has_inline_bytes(entry: dict) -> bool:\n    return isinstance(entry.get(\"bytesBase64Encoded\"), str) and len(entry[\"bytesBase64Encoded\"]) > 0","tryCatchPattern":"try:\n    content = litellm.retrieve_video_content(video_id=vid, vertex_project=proj)\nexcept ValueError as e:\n    if \"No base64 encoded video data\" in str(e):\n        st = litellm.video_status(video_id=vid, vertex_project=proj)\n        gcs = (((st.status_response or {}).get(\"response\", {}) or {}).get(\"videos\", [{}])[0]).get(\"gcsUri\")\n        if gcs:\n            content = download_from_gcs(gcs)  # fallback path for GCS-stored results\n        else:\n            raise\n    else:\n        raise","preventionTips":["Check the status payload for gcsUri before attempting byte download; large videos are stored in GCS.","Request shorter durations/resolutions when you rely on inline base64 payloads.","Keep litellm upgraded so newer Veo response schemas (gcsUri variants) are handled natively."],"tags":["vertex-ai","veo","video-generation","base64","response-parsing"],"backgroundTag":"malformed-provider-response","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}