codec/vaapi: calculate max bit-rate from BaseParam

This commit is contained in:
Atsushi Watanabe
2020-03-21 14:30:41 +09:00
committed by Lukas Herman
parent a3c9949c90
commit 7bb7c9e927
4 changed files with 26 additions and 21 deletions

View File

@@ -67,7 +67,7 @@ func main() {
// This example is using libva's hardware accelerated codec.
// Set encoder parameters to prohibit bitrate overshoot as possible.
cp.RateControlMode = vaapi.RateControlVBR
cp.RateControl.BitsPerSecond = 400000
cp.BitRate = 400000
cp.RateControl.TargetPercentage = 95
c.VideoEncoderBuilders = []codec.VideoEncoderBuilder{&cp}
},