Jump to content

Crowsnest Pi cam with Raspi SBC setup quirk


kenjesse_75

Recommended Posts

 

One of the things that Crowsnest makes available if using a Raspi SBC is the use of the rtsp server in conjunction with webrtc url stream and service to achieve a real-time video stream verses a series of strung together JPEG images that is used otherwise to create the video.  This results in a smoother video (for me anyway) and a big reduction in resource use of the Raspi SBC (per crownests’ info).

Following the Crowsnest Github instructions for setting up the Pi camera to achieve the real-time video ended the same every time for me, a blank screen.   Changing the Service setting in Mainsails “Interface Settings”, “Webcams” back to “Adaptive MJEG-streamer” restored the cameras video.

What I found eventually to be the problem to getting this working is having “Legacy” camera support enabled and/or not using the Bullseye version of Pi OS on the Raspi SBC.  In my case this is a Raspberry Pi 3A and a Raspberry Pi 3B+ between my two printers.  Once on Bullseye OS with camera support disabled the Pi V2 and V3 cameras work very well using the webrtc service producing a very smooth 1920x1080 video.  You need to use "sudo raspi-config" then "Interface Options" to disable the camera support of the Raspi SBC if previously enabled.  One other thing if using the V3 Pi camera to get auto focus working I had to add the following in crowsnest.conf file:

V4l2ctl: AfMode=2

Hope someone finds this info useful but it’s more likely I’m the last person to figure this out.  Stay safe everyone.

** UPDATE ** I should have mentioned how the Pi Cam is id in the system with Legacy enabled versus when Legacy is disabled, this is very important when setting up crowsnest,  Please see my next post for a detailed description, sorry I missed it in this post.

Ken O.

 

Edited by kenjesse_75
Left out important info, I'm old.
  • Like 2
Link to comment
Share on other sites

Interesting...

But not sure I understand.

Pi 4 + Mainsail OS with Fluidd installed with KIAUH, (I use Fluidd 99% of the time), PiCam 2 ; I had to enable the legacy cam support. Was unable to get the camera working without. It also is set to Adaptive MJEG.

I get a smooth 1024x768 video in the browser @30 fps

I had to enable the legacy support. Didn't work without, whatever I did.

At high fps (30), the PC loses its connection to the printer, from time to time, and for a little while : the printer works properly, does not disappear from the DHCP server, but cannot be accessed from the browser nor PuTTY. This does not happen at lower fps. Currently using 15 fps. Wired Ethernet.

Could you share your [pi picam] section in crowsnest.conf, and do a screenshot of your camera settings in Mainsail or Fluidd ?

Link to comment
Share on other sites

YaaJ,

You are correct, if you are NOT using crowsnest with camera-streamer mode and webrtc service you must enable Legacy camera support in the pie to get the camera working.  Which was my original setup before switching to crowsnest.  If you choose to use crowsnest with camera-streamer mode to take advantage of rtsp server and webrtc service for real time video stream you must disable Legacy camera support in the pie to get it working.

My printer with the Pi-3A less than 1 gig memory (I think), my video was always choppy with the normal setup.  Switching to crowsnest setup and using the camera-streamer mode and webrtc service its smooth @ 1920x1080 with a V3 camera and autofocus working.

The reason I posted the info is there is no mention anywhere that  I found regarding the issue with Legacy support enabled in the Pi when trying to use crowsnest with camera-streamer mode and webrtc service with a Pi camera.  It's a non-issue if you're using a usb camera apparently (don't have one to even test).

 

Screenshot2023-10-24181417.jpg.b16fd5175bff2aca5c5290bc94d297ee.jpg

I believe the basic problem is that crowsnest needs the camera to have a 'Libcamera' Device ID (such as above). With Legacy support enabled when a Pi cam V1, V2 or V3 is detected it shows up as 'Raspicam' device --> /dev/video0 (or 1 or 2 if multi cam setup).  With Legacy support disabled the Pi cam is detected as 'Libcamera'  device --> /base/soc (then as above for device:) in my case a Pi V3 cam.

Screenshot2023-10-24181154.jpg.fd2066a5473a04859e6fa9baa94f4b9c.jpg

Once the Pi cam is sorted and crowsnest.conf has the info it's looking for, for me it's onto Mainsail to "Edit Webcam" and change to the above setting to get the real-time webrtc stream working (I believe) via the "rtsp" server which was enabled in crowsnest.conf above.  At this point my video stream is on port 8554 (the rtsp port) not 8080.  If I wanted to watch mine via VLC the url is rtsp://192.xxx.x.xxx:8554/stream.h264.  Which brings up another thing the video format is actually H264 (MP4).  For more detailed info regarding the format it's way out of my wheelhouse and you're on your own.  It is a "reach" to say I barely understand what I've done up to now...LOL

But with all that I hope the info helps.  Be safe all.

Ken O.

  • Like 1
Link to comment
Share on other sites

Thanks for your answer.

Will give it a try, because when enabling the legacy cam support, a message tells that the legacy support will soon be obsolete. Was a bit worried, and didn't know what to do ! (didn't reaaly search, and forgot about it)

I have zero knowledge about video (and audio) streams. Tried the 3 modes in crowsnest.conf, ustreamer worked, stopped tinkering.

 

Link to comment
Share on other sites

  • 1 month later...
On 10/25/2023 at 1:11 AM, kenjesse_75 said:

YaaJ,

You are correct, if you are NOT using crowsnest with camera-streamer mode and webrtc service you must enable Legacy camera support in the pie to get the camera working.  Which was my original setup before switching to crowsnest.  If you choose to use crowsnest with camera-streamer mode to take advantage of rtsp server and webrtc service for real time video stream you must disable Legacy camera support in the pie to get it working.

My printer with the Pi-3A less than 1 gig memory (I think), my video was always choppy with the normal setup.  Switching to crowsnest setup and using the camera-streamer mode and webrtc service its smooth @ 1920x1080 with a V3 camera and autofocus working.

The reason I posted the info is there is no mention anywhere that  I found regarding the issue with Legacy support enabled in the Pi when trying to use crowsnest with camera-streamer mode and webrtc service with a Pi camera.  It's a non-issue if you're using a usb camera apparently (don't have one to even test).

Screenshot2023-10-24181417.jpg.b16fd5175bff2aca5c5290bc94d297ee.jpg

I believe the basic problem is that crowsnest needs the camera to have a 'Libcamera' Device ID (such as above). With Legacy support enabled when a Pi cam V1, V2 or V3 is detected it shows up as 'Raspicam' device --> /dev/video0 (or 1 or 2 if multi cam setup).  With Legacy support disabled the Pi cam is detected as 'Libcamera'  device --> /base/soc (then as above for device:) in my case a Pi V3 cam.

Screenshot2023-10-24181154.jpg.fd2066a5473a04859e6fa9baa94f4b9c.jpg

Once the Pi cam is sorted and crowsnest.conf has the info it's looking for, for me it's onto Mainsail to "Edit Webcam" and change to the above setting to get the real-time webrtc stream working (I believe) via the "rtsp" server which was enabled in crowsnest.conf above.  At this point my video stream is on port 8554 (the rtsp port) not 8080.  If I wanted to watch mine via VLC the url is rtsp://192.xxx.x.xxx:8554/stream.h264.  Which brings up another thing the video format is actually H264 (MP4).  For more detailed info regarding the format it's way out of my wheelhouse and you're on your own.  It is a "reach" to say I barely understand what I've done up to now...LOL

But with all that I hope the info helps.  Be safe all.

Ken O.

 

Thanks this helped me a lot! I've run into the same issue with a rasbpi 4b and a picam v2

For everyone who got problems to get the libcamera id...you'll have to send this on the raspberry while logged in per ssh:

libcamera-hello --list-camera

 

Also there is an issue with building the camera-streamer in the crowsnest. I've got a permanent error while starting up the stream. The underlying libcamera package got an update that breaks manually compiled versions of camera-streamer. To fix this you have to run on the raspberry while logged in per ssh:

cd ~/crowsnest
make update

 

  • Like 1
Link to comment
Share on other sites

17 hours ago, Xyzjin said:

Thanks this helped me a lot! I've run into the same issue with a rasbpi 4b and a picam v2

For everyone who got problems to get the libcamera id...you'll have to send this on the raspberry while logged in per ssh:

libcamera-hello --list-camera

Also there is an issue with building the camera-streamer in the crowsnest. I've got a permanent error while starting up the stream. The underlying libcamera package got an update that breaks manually compiled versions of camera-streamer. To fix this you have to run on the raspberry while logged in per ssh:

cd ~/crowsnest
make update

Glad to hear I was clear enough to be useful.  Thanks for letting know and providing the info about the update issue.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...