ffmpegutil

package
v0.86.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDuration

func GetDuration(md *models.Metadata) int

func GetWidthHeight

func GetWidthHeight(md *models.Metadata) (w, h int)

Types

type FFmpegUtil

type FFmpegUtil struct {
	*transcoder.Transcoder
}

func NewFFmpegUtil

func NewFFmpegUtil() *FFmpegUtil

func (*FFmpegUtil) ConvertToMp4

func (trans *FFmpegUtil) ConvertToMp4(gifPath string) (err error)

func (*FFmpegUtil) ConvertToMp4ByPipe

func (trans *FFmpegUtil) ConvertToMp4ByPipe(gifPath string, dstW, dstH int) (bytes []byte, duration int32, err error)

func (*FFmpegUtil) GetDuration

func (trans *FFmpegUtil) GetDuration() int

func (*FFmpegUtil) GetFirstFrame

func (trans *FFmpegUtil) GetFirstFrame(iFilePath string) (bytes []byte, err error)

GetFirstFrame cmd := exec.Command("ffmpeg", "-i", filename, "-vframes", "1", "-s", fmt.Sprintf("%dx%d", width, height), "-f", "singlejpeg", "-")

func (*FFmpegUtil) GetFirstFrameByPipe

func (trans *FFmpegUtil) GetFirstFrameByPipe(iPipeData []byte) (bytes []byte, err error)

func (*FFmpegUtil) GetHeight

func (trans *FFmpegUtil) GetHeight() int

func (*FFmpegUtil) GetMetadata

func (trans *FFmpegUtil) GetMetadata(iFilePath string) (*models.Metadata, error)

func (*FFmpegUtil) GetMetadataByPipe

func (trans *FFmpegUtil) GetMetadataByPipe(iPipeData []byte) (*models.Metadata, error)

func (*FFmpegUtil) GetWidth

func (trans *FFmpegUtil) GetWidth() int

Directories

Path Synopsis
goffmpeg

Jump to

Keyboard shortcuts

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