Skip to content

Commit

Permalink
add CUDA scaling checker
Browse files Browse the repository at this point in the history
  • Loading branch information
vladaad committed Oct 19, 2022
1 parent eaee67d commit 7b6f719
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions scaler/hwdetect.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package scaler

import (
"github.com/vladaad/discordcompressor/settings"
"os"
"os/exec"
)

func CudaCheck() error {
var options []string
options = append(options, "-y", "-hwaccel", "cuda", "-f", "lavfi", "-i", "nullsrc=2560x1440")
options = append(options, "-vframes", "1", "-an")
options = append(options, "-vf", "hwupload_cuda,scale_cuda=1920:1080:lanczos:p010,hwdownload,format=p010le,format=yuv420p10le")
options = append(options, "-f", "null", "-")

cmd := exec.Command(settings.General.FFmpegExecutable, options...)

cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr

err := cmd.Start()
err = cmd.Wait()
return err
}

0 comments on commit 7b6f719

Please sign in to comment.