Sara.jay.johnny.castle.myfriendshotmom.10.17.2011.wmv Better
Wrap the ffprobe calls in Python with subprocess.check_output and cache the JSON output; you’ll reuse it for later steps (e.g., to know the exact audio sampling rate).
| Feature | Extraction command / code | Typical value / type | |---------|---------------------------|----------------------| | | os.path.getsize(path) | bytes | | Duration | ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 file.wmv | seconds (float) | | Frame rate | ffprobe -v error -select_streams v:0 -show_entries stream=r_frame_rate -of csv=p=0 file.wmv | fps (float) | | Resolution (W × H) | ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=p=0 file.wmv | (int, int) | | Video codec | ffprobe -v error -select_streams v:0 -show_entries stream=codec_name -of csv=p=0 file.wmv | e.g., wmv2 | | Audio codec | ffprobe -v error -select_streams a:0 -show_entries stream=codec_name -of csv=p=0 file.wmv | e.g., aac | | Bitrate (video / audio) | ffprobe -v error -show_entries format=bit_rate -of csv=p=0 file.wmv | kbps | | Creation / modification timestamps | os.stat(path).st_ctime , st_mtime (or use exiftool ) | epoch or human‑readable | | Container format | ffprobe -v error -show_entries format=format_name -of csv=p=0 file.wmv | asf (WMV is an ASF wrapper) | | Number of streams | ffprobe -v error -show_streams -of json file.wmv → count | integer | Sara.Jay.Johnny.Castle.MyFriendsHotMom.10.17.2011.wmv
| Feature | Library / code | Dimensionality | Notes | |---------|----------------|----------------|-------| | | cv2.calcOpticalFlowFarneback between consecutive frames | 2 × H × W (flatten → 2 × N) | Capture direction & magnitude; compute statistics (mean, std, histogram of flow magnitude) | | Dense trajectory descriptors (HOG, HOF, MBH) | pyActionRecog or OpenCV + custom code | 100 – 300 per trajectory | State‑of‑the‑art for action recognition; heavy but very discriminative | | Motion‑energy histogram | Aggregate flow magnitude per frame, then histogram (e.g., 16 bins) | 16 | Simple yet effective for “high‑energy” scenes | | Temporal CNN (e.g., I3D, C3D) | torchvision.models.video.r3d_18(pretrained=True) | 512 (pool) | Requires a stack of 16–32 frames; produces a single embedding for the clip | | Frame‑difference statistics | np.mean(np.abs(frame_t - frame_t-1)) | 1 per interval | Very cheap proxy for motion intensity | Wrap the ffprobe calls in Python with subprocess
: Compute mean, std, skewness, kurtosis across time → ~ (39 + 3 + 1 + 12) × 4 ≈ 220‑dim static audio vector. height -of csv=p=0 file.wmv | (int