video

package
v0.0.0-...-f960f54 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 5, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package video provides video frame extraction and keyframe detection.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupFrames

func CleanupFrames(frames []Frame)

CleanupFrames removes the temporary frame directory

func GetDuration

func GetDuration(inputPath string) (time.Duration, error)

GetDuration returns the duration of a video file using ffprobe

func SaveKeyframes

func SaveKeyframes(keyframes []Keyframe, outputDir string, quality int, scale float64, onProgress ProgressFunc) error

SaveKeyframes saves keyframes as JPEGs with optional scaling and quality settings

Types

type Frame

type Frame struct {
	Path      string
	Index     int
	Timestamp time.Duration
}

Frame represents an extracted video frame

func ExtractFrames

func ExtractFrames(inputPath string, duration time.Duration, onProgress ProgressFunc) ([]Frame, error)

ExtractFrames extracts frames from a video file at 1 fps

type Keyframe

type Keyframe struct {
	Path      string
	Index     int
	Timestamp time.Duration
}

Keyframe represents a frame that differs significantly from its predecessor

func DetectKeyframes

func DetectKeyframes(frames []Frame, threshold float64, onProgress ProgressFunc) ([]Keyframe, error)

DetectKeyframes analyzes frames and returns those that differ significantly from their predecessors based on normalized cross-correlation

type ProgressFunc

type ProgressFunc func(percent float64)

ProgressFunc is called with progress updates (0.0 to 1.0)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL