Unverified Commit c6c5a5f5 authored by Bruno Korbar's avatar Bruno Korbar Committed by GitHub
Browse files

Add warning for files with corrupt containers (#3961)


Co-authored-by: default avatarVasilis Vryniotis <datumbox@users.noreply.github.com>
parent 21426ddc
......@@ -391,9 +391,9 @@ def read_video_timestamps(filename: str, pts_unit: str = "pts") -> Tuple[List[in
except av.AVError:
warnings.warn(f"Failed decoding frames for file {filename}")
video_fps = float(video_stream.average_rate)
except av.AVError:
# TODO add a warning
pass
except av.AVError as e:
msg = f"Failed to open container for {filename}; Caught error: {e}"
warnings.warn(msg, RuntimeWarning)
pts.sort()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment