capture_helper.cli_argparse module

Capture Helper — argparse-based command-line interface.

Thin wrapper around the pure functions in capture_helper that exposes the INPUT layer as subcommands under a single capture-helper entry point. Written with argparse from the standard library so the CLI works out of the box on any Python install that has the package installed — no extra dependency required.

Subcommands

  • list-sources — enumerate cameras / microphones (JSON output)

  • pick-source — resolve one device by kind / name / index (JSON output)

  • input-args — print the ffmpeg -f DRIVER -i SPEC argv fragment

  • capture-camera — grab N frames from a camera and write them to disk

  • capture-mic — record N seconds of microphone PCM to a WAV file

  • scene-auto — emit a scene auto-populated from this host’s devices

  • scene-validate — validate a scene JSON file (exit 0 if well-formed)

  • scene-show — load a scene and report how each source resolves here

Usage Example

>>> #   capture-helper list-sources
>>> #   capture-helper list-sources --kind microphone
>>> #   capture-helper pick-source --kind camera --name FaceTime
>>> #   capture-helper input-args --kind camera --index 0
>>> #   capture-helper capture-camera --output-dir frames/ --output-width 640 \
>>> #       --output-height 360 --fps 30 --max-frames 30
>>> #   capture-helper capture-mic --output mic.wav --seconds 3

Author

Warith Harchaoui, Ph.D. — https://linkedin.com/in/warith-harchaoui/

capture_helper.cli_argparse.build_parser()[source]

Assemble the top-level capture-helper argument parser.

Returns:

Fully wired parser with every subcommand attached.

Return type:

argparse.ArgumentParser

capture_helper.cli_argparse.main(argv=None)[source]

Entry point invoked by capture-helper (see [project.scripts]).

Parameters:

argv (sequence of str, optional) – Arguments to parse. Defaults to sys.argv[1:] when None.

Returns:

Process exit code (0 on success).

Return type:

int