util

package
v0.0.0-...-6db71ed Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeImageDefaultSuffix

func ChangeImageDefaultSuffix(suffix string)

func ChangeVideoDefaultSuffix

func ChangeVideoDefaultSuffix(suffix string)

func FillCommentFields

func FillCommentFields(comment *models.Comment) error

func FillCommentListFields

func FillCommentListFields(comments *[]*models.Comment) error

func FillVideoListFields

func FillVideoListFields(userId int64, videos *[]*models.Video) (*time.Time, error)

FillVideoListFields 填充每个视频的作者信息(因为作者与视频的一对多关系,数据库中存下的是作者的id 当userId>0时,我们判断当前为登录状态,其余情况为未登录状态,则不需要填充IsFavorite字段

func GetDefaultImageSuffix

func GetDefaultImageSuffix() string

func GetFileUrl

func GetFileUrl(fileName string) string

func NewFileName

func NewFileName(userId int64) string

NewFileName 根据userId+用户发布的视频数量连接成独一无二的文件名

func SaveImageFromVideo

func SaveImageFromVideo(name string, isDebug bool) error

SaveImageFromVideo 将视频切一帧保存到本地 isDebug用于控制是否打印出执行的ffmepg命令

Types

type Video2Image

type Video2Image struct {
	InputPath  string
	OutputPath string
	StartTime  string
	KeepTime   string
	Filter     string
	FrameCount int64
	// contains filtered or unexported fields
}

func NewVideo2Image

func NewVideo2Image() *Video2Image

func (*Video2Image) Debug

func (v *Video2Image) Debug()

func (*Video2Image) ExecCommand

func (v *Video2Image) ExecCommand(cmd string) error

func (*Video2Image) GetQueryString

func (v *Video2Image) GetQueryString() (ret string, err error)

Jump to

Keyboard shortcuts

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