V4L2-to-NDI
V4L2-to-NDI copied to clipboard
Question - Has anyone tried this with a Raspberry Pi HQ Camera?
I'm looking to set up a couple of (relatively) cheap NDI cameras in my studio for different angles, and wanted to know if there is any unusual settings I would need to know about to make it work with the HQ Camera.
Okay, I've finally gotten everything set up. Platform is a RPi CM4 (Wifi, 4GB RAM, 32GB eMMC) on a Waveshare CM4-IO-BASE-A. Camera Module is the RPi HQ Camera Module plugged into CAM0 on the Waveshare board. It's running 64-bit Bullseye with the latest updates.
Running libcamera-hello
brings up the expected video, but when I run the command v4l2ndi -d /dev/video0 -f
(or any variation thereof), I get the following:
Mapping /dev/video0 buffer 0, len 4669440 Mapping /dev/video0 buffer 1, len 4669440 Mapping /dev/video0 buffer 2, len 4669440 Mapping /dev/video0 buffer 3, len 4669440 Current Queue Level 1 Queueing /dev/video0 buffer 0 Queueing /dev/video0 buffer 1 Queueing /dev/video0 buffer 2 Queueing /dev/video0 buffer 3 VIDIOC_STREAMON error 22, invalid argument\n
Is there anything I'm missing or anything I can try?
Okay, I tried enabling the legacy camera stack, and it seems to work now. 720p30 seems to be the most stable. 1080p30 is very choppy...
It seems odd why 1080p30 doesn't work. I will do some testing and see if I can find the root cause of this problem.
I do have the full desktop environment running, I could try flashing the lite version and see if that improves.
Also, was I correct to enable the legacy camera stack? I'd prefer to keep libcamera enabled. My ultimate goal is to have a hardware switch where I can toggle HDMI or NDI.
I just tried on Raspberry Pi OS Lite and I am getting the same problem that you are. It seems like the broadcom camera driver can't handle 1080p for some reason. In the meantime, I am going to try to implement a fix so that it will work with libcamera.
The legacy camera stack is the only way that it will work at the moment. Using the new libcamera based stack outputs raw sensor data in a format that my application won't accept.
Understood, and thank you so much for the work you've already put into this! 720p30 will work just fine for now. Now if only I could find some more CM4's...
Let me know if there's anything I can help with as far as testing!
You're welcome :)
Instead of waiting for me to fix this issue, I would suggest checking out this other NDI project on GitHub: https://github.com/raspberry-pi-camera/raspindi It uses the libcamera stack and when I tested it, it worked up to 1080p30 without issues.
Thanks for the tip! I'll give it a shot.