Skip to content

Task done: no rgb_fps input, use video's own fps not default#2

Open
alfarojdd wants to merge 3 commits intodrodriguezSRL:mainfrom
alfarojdd:no-rgbfps-input
Open

Task done: no rgb_fps input, use video's own fps not default#2
alfarojdd wants to merge 3 commits intodrodriguezSRL:mainfrom
alfarojdd:no-rgbfps-input

Conversation

@alfarojdd
Copy link
Copy Markdown

@alfarojdd alfarojdd commented Mar 29, 2026

Description

Main changes

Automatic FPS Detection for Videos

  • The script now automatically detects the video's native FPS using OpenCV.
  • --rgb_fps is now optional for videos (previously required by default).
  • --rgb_fps functions as a manual override when specified.
  • The FPS source is saved in metadata.json: "fps_source": "auto-detected" or "user-provided".

Supported Input Types

Input Behavior
Video Auto-detects FPS (without --rgb_fps), or allows override
Image Directory Requires --rgb_fps or uses default 30 fps
Single Image Uses default, fps_source: "default"

Examples of use

# Auto-detect the native FPS of the video (RECOMMENDED)
python spad_emulator.py input.mp4 --output_dir output_spad

# Manual FPS override
python spad_emulator.py input.mp4 --output_dir output_spad --rgb_fps 60

# Directory of images with specified FPS
python spad_emulator.py ./rgb_frames --output_dir output_spad --rgb_fps 60

Secundary changes

Automatic code reformatting with Ruff (Python formatter/linter)

  • Improved indentation and spacing
  • Very long lines broken
  • Organized imports
  • Cleaner, more readable code

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