video

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultCRF = 25

Variables

This section is empty.

Functions

func DurationSeconds

func DurationSeconds(ctx context.Context, locator Locator, path string) (float64, error)

func EncodeFromPNGDir

func EncodeFromPNGDir(ctx context.Context, cfg EncodeConfig) error

func ExtractSegment

func ExtractSegment(ctx context.Context, locator Locator, src, dst string, fromSec, toSec float64, overwrite bool) error

ExtractSegment copies a time range from src into dst using ffmpeg.

func FileSizeMB

func FileSizeMB(path string) (float64, error)

func GetVideoInfo

func GetVideoInfo(ctx context.Context, locator Locator, videoPath string) (map[string]any, error)

GetVideoInfo mirrors lerobot.datasets.video_utils.get_video_info (v0.5.1).

func ImageDir

func ImageDir(videoKey string, episode int, root string) string

func SafeConcat

func SafeConcat(ctx context.Context, locator Locator, inputs []string, output string, overwrite bool) error

SafeConcat concatenates MP4 files with DTS monotonicity (tier-1 ffmpeg concat).

Types

type Config

type Config struct {
	FFmpegPath  string
	FFprobePath string
}

type EncodeConfig

type EncodeConfig struct {
	Locator    Locator
	VCodec     string
	CRF        int
	FPS        int
	Threads    int
	PNGPattern string
	OutputPath string
}

type Locator

type Locator interface {
	FFmpegPath() (string, error)
	FFprobePath() (string, error)
}

func NewLocator

func NewLocator(cfg Config) Locator

Jump to

Keyboard shortcuts

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