Documentation
¶
Index ¶
- Constants
- func CompressImg(inputPath, outputPath, format string, maxEdgeLength int) error
- func CompressImgForTelegram(input []byte) ([]byte, error)
- func CompressImgForTelegramFromFile(filePath string) (*osutil.TempFile, error)
- func ExtractVideoThumbFrame(r io.Reader) ([]byte, error)
- func FFmpegAvailable() bool
- func GetImagePhash(img image.Image) (string, error)
- func GetImagePhashFromReader(r io.Reader) (string, error)
- func GetImageThumbHash(img image.Image) (string, error)
- func GetImgSize(img image.Image) (int, int, error)
- func GetImgSizeFromReader(r io.Reader) (int, int, error)
- func UgoiraZipToMp4(zipPath string, frames []shared.UgoiraFrame, outputPath string) (string, error)
- type VideoMetadata
Constants ¶
View Source
const ( TelegramMaxPhotoFileSize int = 10 * 1024 * 1024 TelegramMaxPhotoTotalSideLength int = 10000 TelegramMaxPhotoSideLength int = 2560 )
Variables ¶
This section is empty.
Functions ¶
func CompressImg ¶
CompressImg compresses the image at inputPath and saves the result to outputPath.
The input image will be resized so that its longest edge does not exceed maxEdgeLength,
If the maxEdgeLength <= 0, no resizing will be performed.
func CompressImgForTelegram ¶
func FFmpegAvailable ¶
func FFmpegAvailable() bool
func UgoiraZipToMp4 ¶
UgoiraZipToMp4 从 ugoira 的 zip 解压并转换为 mp4
返回生成的 mp4 路径(可能与 outputPath 不同,会自动添加 .mp4 后缀)
Types ¶
type VideoMetadata ¶
func GetMP4Meta ¶
func GetMP4Meta(rs io.ReadSeeker) (*VideoMetadata, error)
a go native way to get mp4 video metadata
func GetVideoMetadata ¶
func GetVideoMetadata(rs io.ReadSeeker) (*VideoMetadata, error)
GetVideoMetadata uses ffprobe to get video metadata
Click to show internal directories.
Click to hide internal directories.