mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
Simple hardware encoding (#3419)
* HW Accel * CUDA Docker build and adjust the NVENC encoder * Removed NVENC preset Using legacy presets is removed in SDK 12 and deprecated since SDK 10. This commit removed the preset to allow ffmpeg to select the default one. --------- Co-authored-by: Nodude <> Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
@@ -9,9 +9,21 @@ import (
|
||||
)
|
||||
|
||||
// FFMpeg provides an interface to ffmpeg.
|
||||
type FFMpeg string
|
||||
type FFMpeg struct {
|
||||
ffmpeg string
|
||||
hwCodecSupport []VideoCodec
|
||||
}
|
||||
|
||||
// Creates a new FFMpeg encoder
|
||||
func NewEncoder(ffmpegPath string) *FFMpeg {
|
||||
ret := &FFMpeg{
|
||||
ffmpeg: ffmpegPath,
|
||||
}
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
// Returns an exec.Cmd that can be used to run ffmpeg using args.
|
||||
func (f *FFMpeg) Command(ctx context.Context, args []string) *exec.Cmd {
|
||||
return stashExec.CommandContext(ctx, string(*f), args...)
|
||||
return stashExec.CommandContext(ctx, string(f.ffmpeg), args...)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user