mirror of
https://github.com/pion/mediadevices.git
synced 2025-10-17 22:21:42 +08:00
Add scale transform to screenshare example
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
_ "github.com/pion/mediadevices/pkg/codec/opus" // This is required to register opus audio encoder
|
||||
_ "github.com/pion/mediadevices/pkg/codec/vpx" // This is required to register VP8/VP9 video encoder
|
||||
_ "github.com/pion/mediadevices/pkg/driver/screen" // This is required to register screen capture adapter
|
||||
"github.com/pion/mediadevices/pkg/io/video"
|
||||
"github.com/pion/webrtc/v2"
|
||||
)
|
||||
|
||||
@@ -52,9 +53,8 @@ func main() {
|
||||
Video: func(c *mediadevices.MediaTrackConstraints) {
|
||||
c.CodecName = videoCodecName
|
||||
c.Enabled = true
|
||||
c.Width = 640
|
||||
c.Height = 480
|
||||
c.BitRate = 100000 // 100kbps
|
||||
c.VideoTransform = video.Scale(640, 480, nil)
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user