feat: auto replace
This commit is contained in:
@@ -12,7 +12,7 @@ tidy:
|
||||
|
||||
.PHONY: release
|
||||
release:
|
||||
@CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags=${flags} -o bin/release/{{.ProjectName}} .
|
||||
@CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags=${flags} -o bin/release/app .
|
||||
@cp config.toml bin/release/
|
||||
|
||||
.PHONY: test
|
||||
|
||||
@@ -264,9 +264,9 @@ func compressVideo(srcPath, dstPath string) error {
|
||||
log.Infof("video size: %dx%d", width, height)
|
||||
|
||||
// cmd := exec.Command("ffmpeg", "-i", srcPath, "-c:v", "libx264", "-crf", "23", "-r", "25", "-c:a", "copy", fmt.Sprintf("'%s'", dstPath))
|
||||
cmd := exec.Command("sh", "-c", fmt.Sprintf("ffmpeg -i '%s' -c:v libx264 -crf 23 -r 25 -c:a copy '%s'", srcPath, dstPath))
|
||||
cmd := exec.Command("sh", "-c", fmt.Sprintf("ffmpeg -i '%s' -y -c:v libx264 -crf 23 -r 25 -c:a copy '%s'", srcPath, dstPath))
|
||||
if width > 1920 || height > 1080 {
|
||||
cmd = exec.Command("sh", "-c", fmt.Sprintf("ffmpeg -i '%s' -c:v libx264 -crf 23 -r 25 -c:a copy -vf scale=1920:1080 '%s'", srcPath, dstPath))
|
||||
cmd = exec.Command("sh", "-c", fmt.Sprintf("ffmpeg -i '%s' -y -c:v libx264 -crf 23 -r 25 -c:a copy -vf scale=1920:1080 '%s'", srcPath, dstPath))
|
||||
}
|
||||
var stderr bytes.Buffer
|
||||
cmd.Stderr = &stderr
|
||||
|
||||
Reference in New Issue
Block a user