From e22c33b78ed43d6a09ad254540abe34ed3cf2660 Mon Sep 17 00:00:00 2001 From: aria Date: Sat, 14 Jun 2025 02:14:20 +1000 Subject: [PATCH] feat: massive additions to output csv --- CLAUDE.md | 66 ++++++++++++++++++++++++++---- main.go | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 171 insertions(+), 14 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 74307ef..fcce2bf 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co ## Project Overview -This is a Go CLI application for video frame analysis and comparison. The project provides tools to count frames in videos, compare individual frames, analyze differences between two videos, and perform frame persistence analysis for single videos. +This is a Go CLI application for professional video frame analysis and comparison. The project provides tools to count frames in videos, compare individual frames, analyze differences between two videos, and perform comprehensive frame persistence analysis for single videos with DigitalFoundry-style CSV output. ## Core Architecture @@ -12,13 +12,15 @@ The application is built using: - **CLI Framework**: urfave/cli/v3 for command-line interface - **Video Processing**: AlexEidt/Vidio library for video file handling with FPS detection - **Image Processing**: Standard Go image libraries for frame comparison +- **CSV Export**: Built-in CSV generation for professional video analysis visualization ### Main Components - **CLI Commands**: Five main commands for comprehensive frame analysis operations - **Frame Comparison**: Pixel-level comparison with configurable tolerance using squared difference - **Video Processing**: Frame-by-frame video analysis with streaming support and memory-efficient processing -- **Frame Persistence Analysis**: Detects consecutive duplicate frames and calculates persistence duration +- **Two-Pass Analysis**: Advanced frame persistence analysis with pre-calculated total durations +- **CSV Generation**: DigitalFoundry-style data export for professional visualization tools ### Key Functions @@ -26,7 +28,7 @@ The application is built using: - `compare_frames()`: Compares two frames with tolerance-based difference detection - `compare_frames_alt()`: Alternative frame comparison using exact pixel matching - `countUniqueVideoFrames()`: Analyzes differences between corresponding frames in two videos -- `analyzeFramePersistence()`: **Main feature** - Analyzes frame persistence in single video with per-second statistics +- `analyzeFramePersistence()`: **Main feature** - Two-pass frame persistence analysis with CSV export - `isDiffUInt8WithTolerance()`: Pixel comparison with configurable tolerance threshold - `imageToRGBA()`: Converts images to RGBA format for consistent processing @@ -56,17 +58,63 @@ Available commands: - `compare-frames ` - Compare two image frames - `count-frames-differing-pixels ` - Count pixel differences between frames - `count-unique-video-frames ` - Compare corresponding frames between two videos -- `analyze-frame-persistence [--tolerance float]