""" preprocessing.py — Shared infrastructure for all forensic tools. Handles: 1. Frame extraction from video via ffmpeg 2. Face detection on extracted frames 3. Loading frames as numpy arrays for analysis Every tool imports from this. No tool extracts frames on its own. """ import subprocess import os import cv2 import numpy as np def extract_frames(video_path, output_dir, every_n=30): """ Extract every Nth frame from a video as PNG files. Uses ffmpeg under the hood: ffmpeg -i