deepfakes/faceswap · error · FaceswapError
Video file '{self._video_file}' cannot be processed. Missing
Error message
Video file '{self._video_file}' cannot be processed. Missing duration metadata What it means
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.
Source
Thrown at lib/video.py:281
Parameters
----------
container
The opened video container
Returns
-------
stream
The first video stream within the container with AUTO threading mode set
Raises
------
FaceswapError
If time_base is not stored within the stream
"""
stream = container.streams.video[self._stream_index]
stream.thread_type = "AUTO"
if stream.time_base is None:
raise FaceswapError(f"Video file '{self._video_file}' cannot be processed. Missing "
"duration metadata")
return stream
def _get_duration(self) -> int:
"""Obtain the duration of the video, in seconds. First attempt to obtain it from the
stream. If this does not exist attempt to obtain it from the container. If this also
does not exist, raise an error
Parameters
----------
stream
The stream to attempt to obtain the duration from
Returns
-------
The duration of the stream in seconds
RaisesView on GitHub (pinned to f530cb7508)
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.
Example fix
# before faceswap extract -i broken.mp4 ... # after (shell) ffmpeg -i broken.mp4 -c copy fixed.mp4 faceswap extract -i fixed.mp4 ...
Defensive patterns
Strategy: validation
Validate before calling
import av
with av.open(video_file) as c:
s = c.streams.video[0]
assert s.time_base is not None, "stream lacks time_base; remux the file first" Prevention
- Remux captures/downloads with ffmpeg -c copy before feeding them to Faceswap.
- Avoid partially downloaded or still-recording files as job inputs.
When it happens
Trigger: 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.
Common situations: Incomplete downloads or interrupted recordings; files produced by buggy muxers; live-stream captures with malformed headers.
Related errors
- There is a mismatch between the number of frames found in th
- The input file '{input_location}' is not a valid video
- Video file '{file_path}' does not exist
- File '{file_path}' is not a valid video file
- Unable to load the model from '{self.filename}'. This may be
AI-assisted analysis of deepfakes/faceswap@f530cb7508 (2026-08-15).
Data as JSON: /api/errors/ecaded4a0d49bdad.
Report an issue: GitHub.