cloud-game/pkg/config/encoder/config.go
sergystepanov fa28197390
Refactor and update VPX codec (#285)
* Refactor and update VPX codec

* Add VPX codec options support

* Add generic video encoding pipe

* Tweak in/out channels for the pipe

* Update YUV encoder

* Clean VP8 encoder
2021-02-27 18:09:55 +03:00

32 lines
466 B
Go

package encoder
type Encoder struct {
Audio Audio
Video Video
WithoutGame bool
}
type Audio struct {
Channels int
Frame int
Frequency int
}
type Video struct {
Codec string
H264 struct {
Crf uint8
Preset string
Profile string
Tune string
LogLevel int
}
Vpx struct {
Bitrate uint
KeyframeInterval uint
}
}
func (a *Audio) GetFrameDuration() int {
return a.Frequency * a.Frame / 1000 * a.Channels
}