ffmpeg

package
Version: v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var VideoCodecs = map[string]string{
	"h264": "libx264",
	"h265": "libx265",
}

VideoCodecs currently supported video codecs

Functions

func Transform

func Transform(input *TransformInput) error

Transform applies the specified transformations on the video file

Types

type InspectInput

type InspectInput struct {
	Filename            string
	ExtractThumbnail    bool
	ThumbnailTimeOffset string
	ThumbnailWidth      int64
	ThumbnailHeight     int64
}

InspectInput the input used to extract the media information

type InspectOutput

type InspectOutput struct {
	Duration float64 `json:"duration"`
	Size     struct {
		Bytes float64 `json:"bytes"`
		Human string  `json:"human"`
	} `json:"size"`
	BitRate   int64         `json:"bit_rate"`
	Thumbnail string        `json:"thumbnail,omitempty"`
	Streams   []*StreamMeta `json:"streams"`
}

InspectOutput represents a media file info

func Inspect

func Inspect(input *InspectInput) (*InspectOutput, error)

Inspect returns a media file information

func (*InspectOutput) String

func (info *InspectOutput) String() string

type StreamMeta

type StreamMeta struct {
	Index       int64     `json:"index"`
	Type        string    `json:"type"`
	Codec       string    `json:"codec"`
	Width       int64     `json:"width,omitempty"`
	Height      int64     `json:"height,omitempty"`
	AspectRatio string    `json:"aspect_ratio,omitempty"`
	StartTime   float64   `json:"start_time"`
	Duration    float64   `json:"duration"`
	BitRate     int64     `json:"bit_rate"`
	FramesCount int64     `json:"frames_count,omitempty"`
	CreatedAt   time.Time `json:"created_at,omitempty"`
}

StreamMeta represents a stream in a media file

type TransformInput

type TransformInput struct {
	Width          int64
	Height         int64
	QualityLevel   int64
	VideoCodec     string
	BitRate        int64
	InputFilename  string
	OutputFilename string
}

TransformInput represents the input used to transform (compress, resize) a video

Jump to

Keyboard shortcuts

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