ffprobe

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package ffprobe runs the bundled ffprobe binary against an HTTP video URL and returns its embedded chapters. ffprobe reads container headers through byte ranges, so a large camera original is never downloaded completely.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chapter

type Chapter struct {
	Title string  `json:"title"`
	Start float64 `json:"start"`
	End   float64 `json:"end"`
}

Chapter is one read-only navigation segment, in seconds from the start.

func Parse

func Parse(output []byte) ([]Chapter, error)

Parse reads ffprobe's JSON chapter listing. Times arrive as decimal strings.

type Command

type Command struct {
	Path    string
	Timeout time.Duration
}

Command locates and bounds the ffprobe process. The zero value uses the ffprobe on PATH with a one-minute budget.

func (Command) Chapters

func (c Command) Chapters(ctx context.Context, url string, headers map[string]string) ([]Chapter, error)

Chapters probes url with the given request headers. Missing chapters are an empty, successful result.

type Error

type Error struct {
	Detail string
}

Error is a failed probe. Detail is ffprobe's own explanation with the URL and every request header value removed, so the message never repeats a key.

func (*Error) Error

func (e *Error) Error() string

Jump to

Keyboard shortcuts

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