ffmpeg

package
v0.0.0-...-f5948c0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 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 H264ToH265ByIntelGPUCmd = `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 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)*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 ToAv1Cmd = CommonCmd + "-c:v libaom-av1 -crf 30 -row-mt 1 -tiles 2x2 -y %s"
View Source
const ToH265Cmd = CommonCmd + "-c:v libx265 -preset veryslow -crf 28 -y %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

func Concat(filePath, dst string) error

func GetFrame

func GetFrame(src string, f Frame) error

func H264ToH265ByIntelGPU

func H264ToH265ByIntelGPU(filePath, dst string) error

func ImgToAvif

func ImgToAvif(filePath, dst string) error

func ImgToHeif

func ImgToHeif(filePath, dst string) error

func ImgToJxl

func ImgToJxl(filePath, dst string) error

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

func ImgToWebp

func ImgToWebp(filePath, dst string) error

图片转webp格式

func ImgToWebp2

func ImgToWebp2(filePath, dst string) error

TODO

func ImgToWebpWithOptions

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

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

func ToAV1ByLibaomav1

func ToAV1ByLibaomav1(filePath, dst string) error

func ToH265ByXlib265

func ToH265ByXlib265(filePath, dst string) error

func TransferFormat

func TransferFormat(filePath, dst string) error

func TransferFormatGPU

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