videoframes

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package videoframes provides an explicit, opt-in local video-frame adapter.

The package owns portable argument, probing, extraction, artifact and result semantics. Hosts still own authorization, approval, sandboxing, dependency installation and whether the tool is registered at all.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnsafeFile marks a symlink, special file or identity-changing input.
	ErrUnsafeFile = errors.New("unsafe local input file")
	// ErrFileTooLarge marks a local input that exceeds the configured byte limit.
	ErrFileTooLarge = errors.New("local input file byte limit exceeded")
)

Functions

func Definition

func Definition() toolcontract.Definition

Definition returns the stable model-facing video_frames declaration.

func FilesTouched

func FilesTouched(items []Frame) []string

FilesTouched returns stable, de-duplicated non-empty frame paths.

func Register

func Register(reg toolcontract.Registrar, adapter *LocalAdapter)

Register adds video_frames only when the explicit adapter and both binaries are available. It does not install dependencies or select a Host policy.

Types

type Frame

type Frame struct {
	FramePath    string                  `json:"frame_path"`
	Index        int                     `json:"index"`
	TimestampSec float64                 `json:"timestamp_sec,omitempty"`
	Media        *agentxmedia.Descriptor `json:"media,omitempty"`
}

Frame describes one retained frame artifact.

type LocalAdapter

type LocalAdapter struct {
	// contains filtered or unexported fields
}

LocalAdapter coordinates one opt-in video_frames implementation. It is safe for concurrent calls after construction.

func NewLocalAdapter

func NewLocalAdapter(opts LocalOptions) *LocalAdapter

NewLocalAdapter constructs an adapter without registering tools or running commands. Missing binary paths use ffmpeg and ffprobe from the Host PATH.

func (*LocalAdapter) Available

func (a *LocalAdapter) Available() bool

Available reports whether both configured command binaries can be resolved.

type LocalOptions

type LocalOptions struct {
	Root          string
	MaxFrames     int
	MaxInputBytes int64
	FFmpegPath    string
	FFprobePath   string
}

LocalOptions configures a host-selected local ffmpeg/ffprobe adapter. Root is a containment boundary, not an authorization or sandbox policy.

type Probe

type Probe struct {
	DurationSec float64 `json:"duration_sec,omitempty"`
	Width       int     `json:"width,omitempty"`
	Height      int     `json:"height,omitempty"`
	FPS         float64 `json:"fps,omitempty"`
}

Probe contains provider-neutral metadata reported by ffprobe.

type Result

type Result struct {
	Tool         string   `json:"tool"`
	Action       string   `json:"action"`
	Status       string   `json:"status"`
	SourceVideo  string   `json:"source_video,omitempty"`
	Strategy     string   `json:"strategy,omitempty"`
	IntervalSec  float64  `json:"interval_sec,omitempty"`
	OutputDir    string   `json:"output_dir,omitempty"`
	FrameCount   int      `json:"frame_count,omitempty"`
	FilesTouched []string `json:"files_touched,omitempty"`
	Probe        *Probe   `json:"probe,omitempty"`
	Frames       []Frame  `json:"frames,omitempty"`
	Warning      string   `json:"warning,omitempty"`
}

Result is the stable JSON result returned by video_frames.

Jump to

Keyboard shortcuts

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