{"record":{"id":"f3ec770c7b680778","repo":"deepfakes/faceswap","slug":"video-file-file-path-does-not-exist","errorCode":null,"errorMessage":"Video file '{file_path}' does not exist","messagePattern":"Video file '(.+?)' does not exist","errorType":"exception","errorClass":"FaceswapError","httpStatus":null,"severity":"error","filePath":"lib/video.py","lineNumber":86,"sourceCode":"    \"\"\"Validates that a given file exists and is a valid video format\n\n    Parameters\n    ----------\n    file_path\n        The full path to the video file to validate\n\n    Returns\n    -------\n    The full expanded video file path\n\n    Raises\n    ------\n    FaceswapError\n        If the given video file is not valid\n    \"\"\"\n    file_path = os.path.expanduser(os.path.abspath(file_path))\n    if not os.path.isfile(file_path):\n        raise FaceswapError(f\"Video file '{file_path}' does not exist\")\n    if os.path.splitext(file_path)[-1].lower() not in VIDEO_EXTENSIONS:\n        raise FaceswapError(f\"File '{file_path}' is not a valid video file\")\n    return file_path\n\n\n# TODO look for instances of this and see if we can roll it into VideoInfo\ndef count_frames(filename, fast=False):\n    \"\"\" Count the number of frames in a video file\n\n    There is no guaranteed accurate way to get a count of video frames without iterating through\n    a video and decoding every frame.\n\n    :func:`count_frames` can return an accurate count (albeit fairly slowly) or a possibly less\n    accurate count, depending on the :attr:`fast` parameter. A progress bar is displayed.\n\n    Parameters\n    ----------\n    filename: str","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/deepfakes/faceswap/blob/f530cb7508ae670f6474f8a7d9c4df94705cf96b/lib/video.py#L68-L104","documentation":"Raised by validate_video_file() in lib/video.py when the expanded, absolutized path does not point at an existing regular file. This is a straight path-existence check performed before any video processing begins.","triggerScenarios":"Calling validate_video_file (directly or via CLI jobs that validate video inputs) with a path to a file that has been moved, deleted, or never existed; relative paths that resolve against an unexpected working directory are also expanded and checked.","commonSituations":"Typos in the -i argument; shell quoting issues with paths containing spaces; running from a different working directory with a relative path; the file being on an unmounted network drive.","solutions":["Verify the path with ls or a file manager and correct it.","Use the absolute path to the video file.","Ensure any quotes/backslashes for spaces in the path are correct in your shell."],"exampleFix":"# before\nfaceswap extract -i vid.mp4 ...   # run from wrong cwd\n\n# after\nfaceswap extract -i /home/user/videos/vid.mp4 ...","handlingStrategy":"validation","validationCode":"import os\nassert os.path.isfile(os.path.expanduser(video_path)), f\"missing video: {video_path}\"","typeGuard":"def is_existing_file(path: str) -> bool:\n    return os.path.isfile(os.path.expanduser(path))","tryCatchPattern":null,"preventionTips":["Expand and absolutize user-supplied paths before passing them to Faceswap jobs.","Use absolute paths in scripts to avoid cwd-dependent resolution."],"tags":["faceswap","video","file-not-found","cli"],"backgroundTag":null,"analyzedSha":"f530cb7508ae670f6474f8a7d9c4df94705cf96b","analyzedAt":"2026-08-15T02:59:26.626Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}