diff --git a/examples/webrtc/main.go b/examples/webrtc/main.go index 598ed49..b0ab8ec 100644 --- a/examples/webrtc/main.go +++ b/examples/webrtc/main.go @@ -9,14 +9,14 @@ import ( "github.com/pion/mediadevices/pkg/prop" "github.com/pion/webrtc/v2" - // If you don't like vpx, you can also use x264 by importing as below - // "github.com/pion/mediadevices/pkg/codec/x264" // This is required to use h264 video encoder + // If you don't like x264, you can also use vpx by importing as below + // "github.com/pion/mediadevices/pkg/codec/vpx" // This is required to use VP8/VP9 video encoder // or you can also use openh264 for alternative h264 implementation // "github.com/pion/mediadevices/pkg/codec/openh264" // or if you use a raspberry pi like, you can use mmal for using its hardware encoder // "github.com/pion/mediadevices/pkg/codec/mmal" - "github.com/pion/mediadevices/pkg/codec/opus" // This is required to use VP8/VP9 video encoder - "github.com/pion/mediadevices/pkg/codec/vpx" // This is required to use VP8/VP9 video encoder + "github.com/pion/mediadevices/pkg/codec/opus" // This is required to use opus audio encoder + "github.com/pion/mediadevices/pkg/codec/x264" // This is required to use h264 video encoder // Note: If you don't have a camera or microphone or your adapters are not supported, // you can always swap your adapters with our dummy adapters below. @@ -44,18 +44,18 @@ func main() { signal.Decode(signal.MustReadStdin(), &offer) // Create a new RTCPeerConnection - vp8Params, err := vpx.NewVP8Params() + x264Params, err := x264.NewParams() if err != nil { panic(err) } - vp8Params.BitRate = 100_000 // 100kbps + x264Params.BitRate = 500_000 // 500kbps opusParams, err := opus.NewParams() if err != nil { panic(err) } codecSelector := mediadevices.NewCodecSelector( - mediadevices.WithVideoEncoders(&vp8Params), + mediadevices.WithVideoEncoders(&x264Params), mediadevices.WithAudioEncoders(&opusParams), )