dejenson
dejensonify - Remove annoying pauses from presentation videos.
dejenson.transcriber
Audio transcription using Whisper.
extract_timestamps
def extract_timestamps(video_path: Path,
model_name: str = "base") -> list[dict]
Extract word-level timestamps from a video using Whisper.
Arguments:
video_path- Path to the video filemodel_name- Whisper model to use (tiny, base, small, medium, large)
Returns:
List of word dictionaries with ‘word’, ‘start’, and ‘end’ keys
save_timestamps
def save_timestamps(words: list[dict], output_path: Path) -> None
Save word timestamps to a JSON file.
load_timestamps
def load_timestamps(input_path: Path) -> list[dict]
Load word timestamps from a JSON file.
dejenson.cli
Command-line interface for dejensonify.
main
def main()
Main entry point for the dejensonify CLI.
dejenson.downloader
Video downloading using yt-dlp.
download_video
def download_video(url: str, output_dir: Path) -> Path
Download a video using yt-dlp.
Arguments:
url- The video URL to downloadoutput_dir- Directory to save the video
Returns:
Path to the downloaded video file
dejenson.gap_detector
Detect gaps/pauses in word timestamps.
find_gaps
def find_gaps(words: list[dict],
max_gap: float = 0.2) -> list[tuple[float, float]]
Find gaps between words that exceed the maximum gap threshold.
Arguments:
words- List of word dictionaries with ‘start’ and ‘end’ keysmax_gap- Maximum allowed gap in seconds (default 0.2)
Returns:
List of (start, end) tuples representing gaps to remove
calculate_keep_segments
def calculate_keep_segments(
words: list[dict],
max_gap: float = 0.2,
video_duration: float | None = None) -> list[tuple[float, float]]
Calculate video segments to keep (inverse of gaps).
Extends segments into gaps by half the max_gap threshold on each side to avoid cutting off breaths, trailing sounds, etc due to Whisper timestamp inaccuracies.
Arguments:
words- List of word dictionaries with ‘start’ and ‘end’ keysmax_gap- Maximum allowed gap in secondsvideo_duration- Total video duration in seconds (if None, uses last word end time)
Returns:
List of (start, end) tuples representing segments to keep
dejenson.video_editor
Video editing using ffmpeg.
get_video_duration
def get_video_duration(video_path: Path) -> float
Get the duration of a video file in seconds.
Arguments:
video_path- Path to the video file
Returns:
Duration in seconds
cut_segments
def cut_segments(video_path: Path,
segments: list[tuple[float, float]],
output_path: Path,
work_dir: Path | None = None) -> None
Cut video segments using ffmpeg select filter in a single pass.
Arguments:
video_path- Path to the input videosegments- List of (start, end) tuples in secondsoutput_path- Path for the output videowork_dir- Unused, kept for compatibility