Documentation
¶
Overview ¶
Package mediainfo provides ffprobe-based video file metadata scanning.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Result ¶
type Result struct {
Container string `json:"container"` // e.g. "mkv", "mp4"
DurationSecs float64 `json:"duration_secs"` // total duration
VideoBitrate int64 `json:"video_bitrate"` // bits/sec (from format or stream)
// Video stream (primary)
Codec string `json:"codec"` // normalised: "x265", "x264", "AV1"
Width int `json:"width"`
Height int `json:"height"`
Resolution string `json:"resolution"` // normalised: "2160p", "1080p", "720p", "SD"
ColorSpace string `json:"color_space"` // e.g. "bt2020nc", "bt709"
HDRFormat string `json:"hdr_format"` // "HDR10", "Dolby Vision", "SDR"
BitDepth int `json:"bit_depth"` // 8, 10, 12
// Audio (primary stream)
AudioCodec string `json:"audio_codec"` // e.g. "eac3", "dts", "aac"
AudioChannels int `json:"audio_channels"` // 2, 6, 8
}
Result holds the actual technical metadata extracted from a video file by ffprobe. All fields are best-effort — missing streams leave fields at zero values.
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner wraps ffprobe for video file metadata extraction. A Scanner with an empty ffprobePath is permanently disabled; all methods are safe to call on a disabled scanner.
func New ¶
New creates a Scanner. ffprobePath may be empty (search $PATH) or an absolute/relative path. If the resolved binary is not found, the scanner is created in disabled state (Available() returns false).
func (*Scanner) FFprobePath ¶
FFprobePath returns the resolved path to ffprobe, or "" if unavailable.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides mediainfo scanning backed by the database.
func NewService ¶
NewService creates a Service. scanner may be a disabled Scanner (Available() returns false); in that case ScanFile and ScanAll are no-ops.
func (*Service) FFprobeVersion ¶
FFprobeVersion returns the resolved ffprobe path for display, or "".