This commit is contained in:
2026-02-26 13:33:05 -08:00
parent 0a88623264
commit c82ac37358

View File

@@ -7,6 +7,7 @@ import (
"os"
"os/exec"
"regexp"
"runtime"
"strconv"
"strings"
)
@@ -57,11 +58,14 @@ func ExportSegments(
)
filterComplex := strings.Join(filterParts, ";")
numCpus := runtime.NumCPU()
cmd := exec.Command("ffmpeg",
"-i", inputPath,
"-filter_complex", filterComplex,
"-map", "[outv]",
"-map", "[outa]",
"-threads", strconv.Itoa(numCpus),
// around 80% compression
"-c:v", "libx264", "-crf", "28", "-preset", "veryfast",
"-c:a", "aac", "-b:a", "128k",