Documentation
¶
Index ¶
- func GetDuration(md *models.Metadata) int
- func GetWidthHeight(md *models.Metadata) (w, h int)
- type FFmpegUtil
- func (trans *FFmpegUtil) ConvertToMp4(gifPath string) (err error)
- func (trans *FFmpegUtil) ConvertToMp4ByPipe(gifPath string, dstW, dstH int) (bytes []byte, duration int32, err error)
- func (trans *FFmpegUtil) GetDuration() int
- func (trans *FFmpegUtil) GetFirstFrame(iFilePath string) (bytes []byte, err error)
- func (trans *FFmpegUtil) GetFirstFrameByPipe(iPipeData []byte) (bytes []byte, err error)
- func (trans *FFmpegUtil) GetHeight() int
- func (trans *FFmpegUtil) GetMetadata(iFilePath string) (*models.Metadata, error)
- func (trans *FFmpegUtil) GetMetadataByPipe(iPipeData []byte) (*models.Metadata, error)
- func (trans *FFmpegUtil) GetWidth() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDuration ¶
func GetWidthHeight ¶
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 (*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
Click to show internal directories.
Click to hide internal directories.