Documentation
¶
Overview ¶
Package probe reads what a source file actually is, using ffprobe.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StoreCrop ¶
StoreCrop caches a crop rectangle, but only if the source file is unchanged since the analysis read its identity.
Parameters:
- path: Cleaned source path, re-read to confirm the identity.
- key: Cache identity of the source file.
- start: Seek offset.
- window: Sampling window.
- rect: Result to store.
Types ¶
type Info ¶
type Info struct {
Duration time.Duration `json:"duration"`
Width int `json:"width"`
Height int `json:"height"`
VideoCodec string `json:"video_codec"`
AudioCodec string `json:"audio_codec"`
Format string `json:"format"`
BitRate int64 `json:"bit_rate"`
ColorTransfer string `json:"color_transfer"`
AudioTracks []Track `json:"audio_tracks"`
}
Info represents media file information.
type Key ¶
type Key struct {
// contains filtered or unexported fields
}
Key is a probed file's identity on disk.
func KeyFor ¶
KeyFor builds the cache identity for a path, reporting whether the file can be identified on disk.
Parameters:
- path: Media file path.
Returns:
- key: The cache identity for the file.
- ok: False when the file cannot be stat'd.
func (Key) CachedCrop ¶
CachedCrop returns a cached crop rectangle for one analysis.
Parameters:
- start: Seek offset.
- window: Sampling window, already clamped by the caller.
Returns:
- rect: The cached rectangle.
- ok: True when the file had been analyzed and still is that file.
func (Key) CachedPeak ¶
CachedPeak returns a cached PQ luma peak for one analysis.
Parameters:
- start: Seek offset.
- window: Sampling window, already clamped by the caller.
Returns:
- peak: The cached peak.
- ok: True when the file had been analyzed and still is that file.
Click to show internal directories.
Click to hide internal directories.