stash/pkg/ffmpeg/codec.go
NodudeWasTaken 0c1b02380e
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>
2023-03-10 11:25:55 +11:00

39 lines
766 B
Go

package ffmpeg
type VideoCodec string
func (c VideoCodec) Args() []string {
if c == "" {
return nil
}
return []string{"-c:v", string(c)}
}
var (
// Software codec's
VideoCodecLibX264 VideoCodec = "libx264"
VideoCodecLibWebP VideoCodec = "libwebp"
VideoCodecBMP VideoCodec = "bmp"
VideoCodecMJpeg VideoCodec = "mjpeg"
VideoCodecVP9 VideoCodec = "libvpx-vp9"
VideoCodecVPX VideoCodec = "libvpx"
VideoCodecLibX265 VideoCodec = "libx265"
VideoCodecCopy VideoCodec = "copy"
)
type AudioCodec string
func (c AudioCodec) Args() []string {
if c == "" {
return nil
}
return []string{"-c:a", string(c)}
}
var (
AudioCodecAAC AudioCodec = "aac"
AudioCodecLibOpus AudioCodec = "libopus"
AudioCodecCopy AudioCodec = "copy"
)