Skip to content

Fix visual frame evidence to show actual video frame indices#20

Merged
jayhack merged 1 commit intomainfrom
codegen-cg-19004-visual-frame-evidence
Jul 13, 2025
Merged

Fix visual frame evidence to show actual video frame indices#20
jayhack merged 1 commit intomainfrom
codegen-cg-19004-visual-frame-evidence

Conversation

@codegen-sh
Copy link
Contributor

@codegen-sh codegen-sh bot commented Jul 13, 2025

Summary

Fixes CG-19004: Updates the visual frame evidence display to show actual video frame indices instead of just the extraction indices.

Problem

Previously, the visual frame evidence showed "Frame 2" and "Frame 3" which were just the sequential extraction indices (frame_002.png, frame_003.png). These numbers didn't represent the actual position within the video, making the evidence confusing and less meaningful.

Solution

  • Store video frame rate: Extract and store the video's fps during metadata analysis
  • Calculate actual video frame indices: Use timestamp × fps to determine real video frame numbers
  • Enhanced discontinuity analysis: Track both extraction indices and actual video frame positions
  • Improved visual evidence: Display actual video frame numbers with proper timestamps
  • Better formatting: Add helper methods for timestamp and file size formatting
  • Template updates: Clarify that these are "Video Frame" indices in the HTML output

Changes Made

Core Logic (epstein_video_analyzer.py)

  • Added self.fps instance variable to store video frame rate
  • Enhanced analyze_frame_discontinuities() to calculate actual video frame indices
  • Added _format_timestamp() and _format_file_size() helper methods
  • Updated visual evidence generation to use real frame indices and timestamps
  • Store actual file sizes from analysis instead of hardcoded values

Template (templates/report.html)

  • Updated display text from "Frame X" to "Video Frame X" for clarity

Testing

  • Added test_frame_indices.py to verify frame calculation logic
  • All timestamp and file size formatting tests pass
  • Frame calculations are accurate within expected rounding tolerance

Example Output

Before:

Frame 2 (6h36m00s): 2,155,188 bytes
Frame 3 (6h36m01s): 2,263,396 bytes

After:

Video Frame 712057 (6h35m59s): 2,155,188 bytes  
Video Frame 712087 (6h36m00s): 2,263,396 bytes

Now the frame numbers represent the actual position within the video (at ~29.97 fps), making the forensic evidence much more meaningful and accurate.

Testing

Run the test script to verify the calculations:

python3 test_frame_indices.py

The changes maintain backward compatibility while providing more accurate and meaningful frame evidence for forensic analysis.


💻 View my workAbout Codegen

- Store video frame rate (fps) as instance variable during metadata extraction
- Calculate actual video frame indices based on timestamp and fps
- Update frame discontinuity analysis to track both extraction indices and video frame indices
- Modify visual evidence display to show actual video frame numbers instead of extraction indices
- Add helper methods for timestamp and file size formatting
- Update HTML template to clarify these are 'Video Frame' indices
- Store actual file sizes from analysis instead of hardcoded values

Fixes CG-19004: Frame indices now represent actual position within video rather than just download order
@jayhack jayhack merged commit 41ddf78 into main Jul 13, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant