{"record":{"id":"02d03321efcfb84c","repo":"invoke-ai/InvokeAI","slug":"input-video-i-self-videos-i-video-name-deco","errorCode":null,"errorMessage":"Input video {i} ({self.videos[i].video_name}) decoded to zero frames.","messagePattern":"Input video (.+?) \\((.+?)\\) decoded to zero frames\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"invokeai/app/invocations/video_concat.py","lineNumber":279,"sourceCode":"                frame = np.ascontiguousarray(frame)\n                n_frames += 1\n                # The clip's first head_want frames are consumed into the boundary blend\n                # with the previous clip's tail rather than emitted directly.\n                if not head_complete:\n                    b_head.append(frame)\n                    if len(b_head) == head_want and blend is not None:\n                        yield from blend(a_tail, b_head)\n                        a_tail = []\n                        b_head = []\n                        head_complete = True\n                    continue\n                # Hold back the last tail_keep frames seen so far; anything older is\n                # guaranteed not to be part of the next boundary and can be emitted.\n                tail_buf.append(frame)\n                if len(tail_buf) > tail_keep:\n                    yield tail_buf.popleft()\n            if n_frames == 0:\n                raise ValueError(f\"Input video {i} ({self.videos[i].video_name}) decoded to zero frames.\")\n            if n_frames < head_want + tail_keep:\n                raise ValueError(\n                    f\"Clip {i} has {n_frames} frames but the requested transitions need \"\n                    f\"{head_want} from its head + {tail_keep} from its tail. Lower \"\n                    f\"transition_frames or use longer clips.\"\n                )\n            a_tail = list(tail_buf)\n","sourceCodeStart":261,"sourceCodeEnd":287,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/invocations/video_concat.py#L261-L287","documentation":"Thrown in _iter_joined_frames when a decoder yields 0 frames for input video i during concat. The joiner needs at least one frame to build boundaries; a zero-frame clip makes concatenation impossible. Usually indicates a corrupt, empty, or wrongly-probed source file.","triggerScenarios":"invoke() -> _iter_joined_frames iterates video i; after the decode loop n_frames == 0 (decoder returned no frames).","commonSituations":"Empty or truncated video files in the input list; codec the decoder cannot handle; broken download producing a header-only file.","solutions":["Check the clip plays in a normal player and is not empty","Re-encode the clip to a standard codec (H.264) before concat","Remove/replace the zero-frame clip in the videos list","Verify the file path resolved by context.videos.get_path points to a real non-empty file"],"exampleFix":"// before\nvideos=[VideoField(video_name='corrupt.mp4')]  # decodes to 0 frames\n// after\nffmpeg -i corrupt.mp4 -c:v libx264 fixed.mp4\nvideos=[VideoField(video_name='fixed.mp4')]","handlingStrategy":"validation","validationCode":"import subprocess\nn = subprocess.run(['ffprobe','-v','error','-select_streams','v:0','-count_frames','-show_entries','stream=nb_read_frames','-of','csv=p=0', path], capture_output=True, text=True)\nif not n.stdout.strip() or n.stdout.strip() == '0':\n    raise ValueError(f'{path} decodes to zero frames')","typeGuard":"def has_frames(probe_result) -> bool:\n    return bool(probe_result and probe_result.get('nb_read_frames', 0) > 0)","tryCatchPattern":"try:\n    out = concat.invoke(context)\nexcept ValueError as e:\n    if 'decoded to zero frames' in str(e):\n        videos = [v for v in videos if not is_empty_clip(v)]\n        out = rebuild(videos).invoke(context)\n    else:\n        raise","preventionTips":["Pre-flight check every input with ffprobe before concat","Validate downloads complete (file size / hash)","Re-encode unusual codecs to H.264 up front"],"tags":["video","decoding","input-validation"],"backgroundTag":"empty-video-frames","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}