Skip to content

num_frames

num_frames

num_frames(vids: tuple[Path]) -> None

Calculate the number of frames in the given videos.

Source code in src/encode_utils_cli/num_frames.py
 8
 9
10
11
12
13
14
15
16
17
18
@click.command()
@click.argument(
    "vids",
    nargs=-1,
    required=True,
    type=click.Path(exists=True, dir_okay=False, path_type=Path),
)
def num_frames(vids: tuple[Path]) -> None:
    """Calculate the number of frames in the given videos."""
    for vid in vids:
        click.echo(f"{vid.stem}.num_frames: {source(vid).num_frames}")