util

package
v0.0.0-...-4d6a32e Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExifToolPreview

func ExifToolPreview(dst, src string) error

func FFProbeInfo

func FFProbeInfo(file string) (string, error)

func Sha256

func Sha256(reader io.ReadSeeker) (string, error)

Types

type CodecType

type CodecType string
const (
	Video CodecType = "video"
	Audio CodecType = "audio"
)

type CommandOutput

type CommandOutput []byte

func FFMpegScaleImage

func FFMpegScaleImage(dst, src string, scale float64) (CommandOutput, error)

func FFMpegVideoSampleImage

func FFMpegVideoSampleImage(video, image string, scale float64, tile image.Point) (CommandOutput, error)

type FFProbeFormat

type FFProbeFormat struct {
	Filename       string `json:"filename"`
	NbStreams      int    `json:"nb_streams"`
	NbPrograms     int    `json:"nb_programs"`
	NbStreamGroups int    `json:"nb_stream_groups"`
	FormatName     string `json:"format_name"`
	FormatLongName string `json:"format_long_name"`
	StartTime      string `json:"start_time"`
	Duration       string `json:"duration"`
	Size           string `json:"size"`
	BitRate        string `json:"bit_rate"`
	ProbeScore     int    `json:"probe_score"`
	Tags           any    `json:"tags"`
}

type FFProbeJson

type FFProbeJson struct {
	Streams []FFProbeStream `json:"streams"`
	Format  FFProbeFormat   `json:"format"`
}

func FFProbe

func FFProbe(file string) (*FFProbeJson, error)

func (*FFProbeJson) Duration

func (f *FFProbeJson) Duration() (time.Duration, error)

func (*FFProbeJson) NBFrames

func (f *FFProbeJson) NBFrames(ct CodecType) (uint64, error)

func (*FFProbeJson) Size

func (f *FFProbeJson) Size() image.Point

type FFProbeStream

type FFProbeStream struct {
	Index         int       `json:"index"`
	CodecName     string    `json:"codec_name"`
	CodecLongName string    `json:"codec_long_name"`
	Profile       string    `json:"profile"`
	CodecType     CodecType `json:"codec_type"`
	CodecTagStr   string    `json:"codec_tag_string"`
	CodecTag      string    `json:"codec_tag"`
	NbFrames      string    `json:"nb_frames"`
	Width         int       `json:"width"`
	Height        int       `json:"height"`
}

Jump to

Keyboard shortcuts

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