videoio

package
v0.209.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package videoio samples frames from a local video file (via ffmpeg) into data:image/...;base64 URIs for the multimodal vision path. It NEVER fetches a remote URL — only local files. Frames, not weights, are the 8GB VRAM pressure, so callers cap maxFrames.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Duration added in v0.206.0

func Duration(videoPath, ffmpegPath string) (float64, error)

Duration returns the container duration of videoPath in seconds via ffprobe.

func ProbePath added in v0.206.0

func ProbePath(ffmpegPath string) string

ProbePath derives the ffprobe executable that ships next to ffmpegPath ("ffmpeg" -> "ffmpeg's sibling ffprobe"); an unqualified "ffmpeg" resolves through PATH the same way.

func SampleFrames

func SampleFrames(videoPath, ffmpegPath string, fps float64, maxFrames, width, maxBytesPerFrame int) ([]string, error)

SampleFrames extracts up to maxFrames frames from videoPath at fps, each scaled to width px wide, and returns them as data:image/jpeg;base64 URIs (in order). ffmpegPath is the ffmpeg executable ("" => "ffmpeg"). A frame exceeding maxBytesPerFrame is rejected (guards the activation budget). The temp frame dir is always cleaned up.

func SampleFramesWindow added in v0.206.0

func SampleFramesWindow(videoPath, ffmpegPath string, start, dur, fps float64, maxFrames, width, maxBytesPerFrame int) ([]string, error)

SampleFramesWindow is SampleFrames over the [start, start+dur) window of the video only. video_watch sweeps a whole file window by window with it, so a long clip is seen END TO END instead of only its first maxFrames/fps seconds.

Types

This section is empty.

Jump to

Keyboard shortcuts

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