Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

Repository files navigation

num-frames-maker

A frame-count file generator for video clip configuration. Reads a YAML config describing a video sequence and produces one text file per clip containing the total frame count.

How It Works

  1. Reads the first .yaml or .yml file found in 01.input/.
  2. Validates required fields: num_clips, duration_seconds, fps.
  3. Calculates total frames per clip: total_frames = fps × duration_seconds.
  4. Generates {n}.txt files (one per clip, numbered 1 to num_clips), each containing the calculated frame count.
  5. Output goes to a timestamped directory under 02.output/.

Input YAML Format

Place a .yaml file in 01.input/. The tool uses the first one it finds.

num_clips: 5          # Number of clips / output files to generate
duration_seconds: 10  # Duration of each clip in seconds
fps: 30               # Frames per second

Formula

total_frames per clip = fps × duration_seconds

Example: 30 × 10 = 300 → each .txt file contains "300"

Output Structure

02.output/
└── YYMMDD_HHMMSS_GENERATED_NUM_FRAMES/
    ├── 1.txt   # Contains "300"
    ├── 2.txt   # Contains "300"
    ├── 3.txt   # Contains "300"
    ├── 4.txt   # Contains "300"
    └── 5.txt   # Contains "300"

Error Handling

Condition Behaviour
01.input/ does not exist Error message, exit code 1
No .yaml/.yml files in input Error message, exit code 1
Missing num_clips, duration_seconds, or fps Error message, exit code 1
Invalid YAML syntax Error message, exit code 1

Setup & Usage

# One-command run (auto-installs dependencies):
python3 run.py

# Or manually:
pip install pyyaml>=6.0
python3 generate_frames.py

Dependencies

  • pyyaml>=6.0 (only dependency)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages