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