Closed learncodingforweb closed 1 year ago
Tried example https://github.com/pion/mediadevices/blob/master/examples/webrtc/main.go
s, err := mediadevices.GetUserMedia(mediadevices.MediaStreamConstraints{ Video: func(c *mediadevices.MediaTrackConstraints) { c.FrameFormat = prop.FrameFormat(frame.FormatI420) c.Width = prop.Int(640) c.Height = prop.Int(480) }, Audio: func(c *mediadevices.MediaTrackConstraints) { }, Codec: codecSelector, }) if err != nil { fmt.Println("phase 3") panic(err) }
Getting panic error phase 3 panic: failed to find the best driver that fits the constraints
I tried example https://github.com/pion/mediadevices/blob/master/examples/webrtc/ -->
Should open usb camera and send stream of data on webrtc communication.
It failed to open usb camera.
Fixed importing
_ "github.com/pion/mediadevices/pkg/driver/camera" _ "github.com/pion/mediadevices/pkg/driver/microphone"
Tried example https://github.com/pion/mediadevices/blob/master/examples/webrtc/main.go
Getting panic error phase 3 panic: failed to find the best driver that fits the constraints
Your environment.
What did you do?
I tried example https://github.com/pion/mediadevices/blob/master/examples/webrtc/ -->
What did you expect?
Should open usb camera and send stream of data on webrtc communication.
What happened?
It failed to open usb camera.