ffmpeg

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const CommonCmd = `ffmpeg -i %s `
View Source
const ConcatCmd = `ffmpeg  -f concat  -safe 0  -i %s -c copy -y %s`
View Source
const GetFrameCmd = CommonCmd + `-vf "select=eq(pict_type\,%s)" -fps_mode vfr -qscale:v 2 -f image2 %s/%%03d.jpg`
View Source
const GifToWebpCmd = CommonCmd + `-c:v libwebp -lossless 1 -quality 100 -compression_level 6 %s.webp`
View Source
const ImgTAvifCmd = CommonCmd + `-c:v libaom-av1 -still-picture 1 %s.avif`
View Source
const ImgToHeifCmd = CommonCmd + `-crf 12 -psy-rd 0.4 -aq-strength 0.4 -deblock 1:1 -vf "scale=trunc(iw/2):trunc(ih/2)*2" -preset veryslow -pix_fmt yuv420p101e -f hevc %s.hevc`
View Source
const ImgToHeifCmd2 = `` /* 206-byte string literal not displayed */
View Source
const ImgToHeifCmd3 = `` /* 238-byte string literal not displayed */
View Source
const ImgToJxlCmd = CommonCmd + `-c:v libjxl %s.jxl`
View Source
const ImgToWebpCmd = CommonCmd + `-c:v libwebp -lossless 1 -quality 100 -compression_level 6 %s.webp`
View Source
const ImgToWebpWithOptionsCmd = CommonCmd + `-c:v libwebp -quality %d %s.webp`
View Source
const ResizeCmd = CommonCmd + `-vf "scale=iw*.5:ih*.5" %s`
View Source
const TransferCodecByIntelGPUCmd = `ffmpeg -hwaccel_output_format qsv -c:v h264_qsv -i %s -c:v hevc_qsv -preset veryslow -g 60 -gpu_copy 1 -c:a copy %s`
View Source
const TransferFormatCmd = `ffmpeg -i %s -c copy -y %s`
View Source
const TransferFormatGPUCmd = `ffmpeg -hwaccel qsv -i %s -c copy -y %s`

Variables

This section is empty.

Functions

func Concat added in v1.1.0

func Concat(filePath, dst string) error

func GetFrame

func GetFrame(src string, f Frame) error

func H264ToH265

func H264ToH265(filePath, dst string) error

func ImgToAvif added in v1.1.0

func ImgToAvif(filePath, dst string) error

func ImgToHeif added in v1.1.0

func ImgToHeif(filePath, dst string) error

func ImgToJxl added in v1.1.0

func ImgToJxl(filePath, dst string) error

不可用,没有注明色彩空间的原因。需要显式写明 像素编码格式、色彩空间、转换色彩空间、目标色彩空间、色彩范围

func ImgToWebp added in v1.1.0

func ImgToWebp(filePath, dst string) error

图片转webp格式

func ImgToWebp2 added in v1.1.0

func ImgToWebp2(filePath, dst string) error

TODO

func ImgToWebpWithOptions added in v1.1.0

func ImgToWebpWithOptions(filePath, dst string, quality int) error

图片带选项转webp格式,选项目前支持质量

func ResizeImg added in v1.1.0

func ResizeImg(filePath, dst string) error

func TransferFormat

func TransferFormat(filePath, dst string) error

func TransferFormatGPU added in v1.1.0

func TransferFormatGPU(filePath, dst string) error

Types

type Frame

type Frame int
const (
	I Frame = iota
	P
	B
)

func (Frame) String

func (f Frame) String() string

Jump to

Keyboard shortcuts

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