{"record":{"id":"ecaded4a0d49bdad","repo":"deepfakes/faceswap","slug":"video-file-self-video-file-cannot-be-processe","errorCode":null,"errorMessage":"Video file '{self._video_file}' cannot be processed. Missing duration metadata","messagePattern":"Video file '(.+?)' cannot be processed\\. Missing duration metadata","errorType":"exception","errorClass":"FaceswapError","httpStatus":null,"severity":"error","filePath":"lib/video.py","lineNumber":281,"sourceCode":"        Parameters\n        ----------\n        container\n            The opened video container\n\n        Returns\n        -------\n        stream\n            The first video stream within the container with AUTO threading mode set\n\n        Raises\n        ------\n        FaceswapError\n            If time_base is not stored within the stream\n        \"\"\"\n        stream = container.streams.video[self._stream_index]\n        stream.thread_type = \"AUTO\"\n        if stream.time_base is None:\n            raise FaceswapError(f\"Video file '{self._video_file}' cannot be processed. Missing \"\n                                \"duration metadata\")\n        return stream\n\n    def _get_duration(self) -> int:\n        \"\"\"Obtain the duration of the video, in seconds. First attempt to obtain it from the\n        stream. If this does not exist attempt to obtain it from the container. If this also\n        does not exist, raise an error\n\n        Parameters\n        ----------\n        stream\n            The stream to attempt to obtain the duration from\n\n        Returns\n        -------\n        The duration of the stream in seconds\n\n        Raises","sourceCodeStart":263,"sourceCodeEnd":299,"githubUrl":"https://github.com/deepfakes/faceswap/blob/f530cb7508ae670f6474f8a7d9c4df94705cf96b/lib/video.py#L263-L299","documentation":"Raised by MovManager/_get_stream in lib/video.py when the first video stream of the container reports a None time_base. Without a time base, timestamps cannot be converted to seconds, so any duration/seek computation is impossible; Faceswap refuses the file rather than producing garbage timings.","triggerScenarios":"Opening (av.open) a truncated, corrupted, or non-standard container whose stream metadata lacks time_base — e.g. a partially downloaded file, a broken remux, or a raw stream dumped without proper container headers.","commonSituations":"Incomplete downloads or interrupted recordings; files produced by buggy muxers; live-stream captures with malformed headers.","solutions":["Repair/remux the file with ffmpeg: ffmpeg -i broken.mp4 -c copy fixed.mp4, then use the fixed file.","Re-download or re-record the source if remuxing fails.","If the file plays in a player, extract to images first (or a clean intermediate) and feed those to Faceswap instead."],"exampleFix":"# before\nfaceswap extract -i broken.mp4 ...\n\n# after (shell)\nffmpeg -i broken.mp4 -c copy fixed.mp4\nfaceswap extract -i fixed.mp4 ...","handlingStrategy":"validation","validationCode":"import av\nwith av.open(video_file) as c:\n    s = c.streams.video[0]\n    assert s.time_base is not None, \"stream lacks time_base; remux the file first\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remux captures/downloads with ffmpeg -c copy before feeding them to Faceswap.","Avoid partially downloaded or still-recording files as job inputs."],"tags":["faceswap","video","pyav","metadata","corruption"],"backgroundTag":null,"analyzedSha":"f530cb7508ae670f6474f8a7d9c4df94705cf96b","analyzedAt":"2026-08-15T02:59:26.626Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}