Open johnscode opened 1 year ago
Hey @johnscode, Is legacy camera support enabled? (https://www.youtube.com/watch?v=E7KPSc_Xr24)
yes. using raspi-config, legacy camera support was enabled for this.
I have the same issue trying to run the examples/http
using a raspberry pi 4 with a pi camera module 3
I've also just started getting this error. I suspect underlying Pi camera driver must have automatically updated because my Go service was working with the camera stream until my Pi was rebooted a couple days ago. The camera stream works fine on my laptop so I think this issue is probably at a lower level than Pion. I will report any further findings here.
(UPDATE - Please see RPi Forum post here: https://forums.raspberrypi.com/viewtopic.php?t=369927)
FWIW, I recently updated libcamera (and rpicam-app), and now I get: [5:14:13.575871523] [8761] ERROR V4L2 v4l2_videodevice.cpp:1906 /dev/video0[21:cap]: Failed to start streaming: Invalid argument
whenever I've changed the cropping width/height away from the default. For example, media-ctl -d "/dev/media3" --set-v4l2 "'imx296 10-001a':0 [fmt:SBGGR10_1X10/100x100 crop:(0,0)/100x100]" -v
Has anyone had a similar experience?
Your environment.
What did you do?
Trying to run the jpeg snapshot example from the main Readme: import ( "image/jpeg" "os"
) func main() { stream, _ := mediadevices.GetUserMedia(mediadevices.MediaStreamConstraints{ Video: func(constraint *mediadevices.MediaTrackConstraints) { // Query for ideal resolutions constraint.Width = prop.Int(640) constraint.Height = prop.Int(480) }, })
} example runs fine on OSX. runs to completion on pi when substituting the test drivers in the imports, ie // "github.com/pion/mediadevices/pkg/driver/camera" "github.com/pion/mediadevices/pkg/driver/videotest"
attempt to run using go run main.go
What did you expect?
successful run producing a jpeg file
What happened?
panic failure at line 28
error is occurring due to the line: stream, _ := mediadevices.GetUserMedia( ....
If i change it to check the error: stream, err := mediadevices.GetUserMedia( .... if err != nil { fmt.Printf("%+v\n",err) return } error reported is: 'Failed to start streaming: invalid argument'
If I run (with the real driver imported) using: export PION_LOG_DEBUG=all && go run main.go i get output showing several configurations that match the constraints, with final one shown being 'best fit':
================ Best Fit ================
DeviceID: b1a30cff-6365-4313-9c8f-e96fd5cadee0 Video: Width: 640 Height: 480 FrameRate: 0 FrameFormat: UYVY Audio: ChannelCount: 0 Latency: 0s SampleRate: 0 SampleSize: 0 IsBigEndian: false IsFloat: false IsInterleaved: false
then the error
Should point out that this is using an onboard pi camera and not a usb camera.
fwiw: the onboard camera is accessible using the standard libcamera apis (in cpp). the blackjack webcam lib works for usb cams on a pi, but not the onboard cam