Documentation
¶
Index ¶
- Constants
- Variables
- func Concat(dir, dst string) error
- func ConcatByFile(filePath, dst string) error
- func GetFrame(path, outPutDir string, f Frame) error
- func H264ToH265ByIntelGPU(filePath, dst string) error
- func ImgToAvif(filePath, dst string, crf, cpuUsed int) error
- func ImgToHeic(filePath, dst string) error
- func ImgToJxl(filePath, dst string) error
- func ImgToWebp(filePath, dst string, quality int) error
- func ImgToWebpLossless(filePath, dst string) error
- func Run(cmd string) error
- func ToAV1ByLibaomav1(filePath, dst string, crf, cpuUsed int) error
- func ToH264ByXlib264(filePath, dst string, crf int, perset PerSet) error
- func ToH265ByXlib265(filePath, dst string, crf int, perset PerSet) error
- func TransferFormat(filePath, dst string) error
- func TransferFormatGPU(filePath, dst string) error
- type Config
- type Frame
- type PerSet
Constants ¶
View Source
const CommonCmd = ` -i "%s" -y `
View Source
const ConcatCmd = ` -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 H264ToH265ByIntelGPUCmd = `ffmpeg -hwaccel 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 ImgToHeicCmd = CommonCmd + `-crf 20 -c:v libx265 -preset veryslow %s.mp4`
View Source
const ImgToHeicCmd2 = CommonCmd + `-hide_banner -r 1 -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2,zscale=m=170m:r=pc" -pix_fmt yuv420p -frames 1 -c:v libx265 -preset veryslow -crf 20 -x265-params range=full:colorprim=smpte170m "%s.hevc"`
View Source
const ImgToHeicCmd3 = CommonCmd + `-hide_banner -r 1 -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2,zscale=m=170m:r=pc" -pix_fmt yuv420p -frames 1 -c:v libx265 -preset veryslow -crf 20 -x265-params range=full:colorprim=smpte170m:aq-strength=1.2 -deblock -2:-2 "%s.hevc"
`
View Source
const ImgToJxlCmd = CommonCmd + `-c:v libjxl "%s.jxl"`
View Source
const ImgToTAvifCmd = CommonCmd + `-c:v libaom-av1 -crf %d -cpu-used %d -row-mt 1 "%s.avif"`
View Source
const ImgToWebpCmd = CommonCmd + `-c:v libwebp -quality %d "%s.webp"`
View Source
const ImgToWebpLosslessCmd = CommonCmd + `-c:v libwebp -lossless 1 -quality 100 -compression_level 6 "%s.webp"`
webp lossless mode
View Source
const ResizeCmd = CommonCmd + `-vf "scale=iw*.5:ih*.5" %s`
View Source
const ToAv1Libaomav1Cmd = CommonCmd + `-c:v libaom-av1 -crf %d -cpu-used %d -row-mt 1 -y "%s"`
libaom-av1
View Source
const ToH264Cmd = CommonCmd + `-c:v libx264 -profile high -preset %s -crf %d -y "%s"`
libx264
View Source
const ToH265Cmd = CommonCmd + `-c:v libx265 -preset %s -crf %d -y "%s"`
libx265
View Source
const TransferFormatCmd = CommonCmd + ` -c copy -y "%s"`
View Source
const TransferFormatGPUCmd = ` -hwaccel qsv -i "%s" -c copy -y "%s"`
Variables ¶
View Source
var ExecPath = "ffmpeg"
Functions ¶
func ConcatByFile ¶
ConcatByFile performs the operation.
func H264ToH265ByIntelGPU ¶
H264ToH265ByIntelGPU performs the operation.
func ImgToWebpLossless ¶
ImgToWebpLossless performs the operation.
func ToAV1ByLibaomav1 ¶
ToAV1ByLibaomav1 converts the value.
func ToH264ByXlib264 ¶
ToH264ByXlib264 converts the value.
func ToH265ByXlib265 ¶
ToH265ByXlib265 converts the value.
func TransferFormat ¶
TransferFormat performs the operation.
func TransferFormatGPU ¶
TransferFormatGPU performs the operation.
Types ¶
Click to show internal directories.
Click to hide internal directories.