num cpu
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user