mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-07-20 16:54:25 +00:00
* 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
32 lines
466 B
Go
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
|
|
}
|