Hi, hoping someone can help. I recently upgraded one of my security cameras from an Arducam OV5647 (the one that plugs straight onto the Pi camera connector) to one of the newer low-light cameras, and I just can’t get it to work with the video stream.
When I view it directly the frame rate is only like 3 or 4 per second and it’s really choppy, not smooth at all. And I can’t get it to stream over VLC to view it remotely, even though my old Arducam OV5647 streamed perfectly over VLC. The new camera kind of works sometimes but it’s really unstable.
I’ve been following the instructions that came with my older Arducam OV5647 and tried fiddling with the code but no luck. I posted the details of my code and where I got stuck over on the VLC forum here: Making sure you're not a bot!
What I really want is a guide on how to get this camera to stream to an http port so I can view it remotely from other devices, ideally with VLC since that’s what my current Arducam setups use, but it doesn’t have to be VLC as long as I can access it. I want to upgrade the rest of my cameras but only if I can get this one working first. Thanks!
First thing that jumps out: your old OV5647 and your new camera are actually two very different kinds of hardware.
The OV5647 connects directly to the Raspberry Pi camera connector (CSI) and is driven by the Pi’s own camera stack (raspistill/raspivid, mmal, etc).
The newer low-light camera is almost certainly a USB UVC (USB Video Class) camera. It doesn’t use the Pi camera connector at all, and the OV5647 instructions/code won’t apply to it.
That’s likely a big part of why nothing you’ve tried has worked. Can you confirm a few things?
What’s the exact model number on the box?
How is it connected to the Pi - USB or the camera ribbon connector?
Also, quick thing to try while you’re at it: change the output format to MJPG instead of the default (usually YUYV). UVC cams will often give you a much higher frame rate in MJPG. Let me know how it goes.
Model number on the box: X002HZMSPH or UB020201 - both numbers are on the box. It’s listed as a 1080p low light USB camera.
It’s a USB camera, it plugs into the USB port on the Pi 3b.
Platform is a Raspberry Pi 3b, and I’m accessing it from Ubuntu, Windows 10 and Android 12, all via VLC media player.
So yes, it’s a UVC camera. I was following the instructions that came with the older OV5647 model because that’s what I had before, I guess that was the wrong thing to do. Has it ever worked properly? Only sort of - it works intermittently and it’s unstable. Direct view is like 3-4 fps and choppy.
OK, that confirms it - your new camera is a UVC device, so the OV5647 guide definitely doesn’t apply. Forget the old code from the VLC thread for now.
Two things to tackle:
The 3-4 fps is usually the camera running in an uncompressed format (YUYV) over USB, which can saturate the bus on a Pi 3b. Switching to MJPG should help the frame rate a lot.
Getting it onto an http port for remote viewing.
To list and test the camera’s modes:
v4l2-ctl --list-formats-ext -d /dev/video0
Look for the MJPG entries. Then try:
v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=MJPG
For streaming, the simplest reliable option on a Pi is mjpg-streamer, which gives you an http://:8080/?action=stream you can open in VLC:
vlc http://:8080/?action=stream
Can you run that list-formats command and paste what you get? I want to see which modes the camera actually advertises.
Here’s what that command gave me… I didn’t save the full output but I can see entries for YUYV and MJPG in a couple of resolutions, and MJPG is showing much higher fps than YUYV. So you were right about the format.
I tried setting MJPG and it’s still not working properly. When I view it directly it’s still choppy, only around 3-4 fps, and I still can’t stream via VLC. The camera also drops out after a while, which is the unstable part.
The whole thing is weird because the old Arducam OV5647 was rock solid and streamed fine over VLC. This new one just won’t behave.
Good, that list at least confirms the camera can do MJPG. If it’s still 3-4 fps after setting MJPG, then we’re either not actually capturing in MJPG, the app is falling back to YUYV, or the USB link is the bottleneck.
A few things to check:
Confirm the format actually stuck:
v4l2-ctl -d /dev/video0 --get-fmt-video
See how the camera enumerates on the USB bus and whether it’s dropping off:
lsusb
dmesg | tail -50
Test the raw capture independently of any streaming app to rule the app out:
ffmpeg -f v4l2 -input_format mjpeg -video_size 1920x1080 -i /dev/video0 -c:v copy -f mjpeg test.avi
If that ffmpeg capture is smooth, the camera is fine and it’s your streaming setup. If it’s choppy too, it’s lower down at the USB/format level.
Also worth trying a lower resolution temporarily (e.g. 1280x720) to see if the frame rate improves - that tells us if it’s a bandwidth issue. And swap the USB cable / try a different port if you can.
Paste the dmesg output and the get-fmt-video output and we’ll go from there.
OK, I ran get-fmt-video and it says the format is set to MJPG now, so that part stuck.
I tried the ffmpeg capture and it’s… still choppy. So I guess it’s not the streaming app. The dmesg output mostly looks fine at first but after a while there are messages about the device disconnecting and reconnecting, which would explain the instability.
I didn’t have time to try 720p yet. Do you think the Pi 3b just can’t handle this camera at 1080p? The old OV5647 was on the CSI port so it never touched the USB bus.
Thanks, that’s really useful. The disconnect/reconnect messages in dmesg plus choppy raw capture strongly suggest a USB-level problem rather than a streaming config problem. A couple of common causes on a Pi 3b:
Power/USB bandwidth: 1080p MJPG plus anything else on the bus can exceed what the Pi 3b can feed. The CSI camera never had this issue because it doesn’t share USB.
The camera drawing more than the port can supply, causing dropouts.
Things to try:
Definitely test 720p (lower size, higher fps) and also a lower frame rate at 1080p.
Put the camera on its own bus if it isn’t already - on a Pi 3b, avoid a USB hub that shares bandwidth with other devices.
Make sure nothing else heavy is on USB.
Try a good quality, short cable.
Also, is it a powered hub or straight into the Pi? And can you paste the actual dmesg lines around the disconnect? That’ll tell us if it’s an over-current or bandwidth style error.
Given it works intermittently and only at 3-4 fps, this still points to either a bandwidth limit or a power stability issue, and I don’t want to guess until we see those messages.
Plugged straight into the Pi, no hub. I’ll try 720p and grab the dmesg lines when it disconnects. It might be a day or two before I get to it but I’ll post back. Thanks for sticking with me on this.
No problem at all - post back whenever you’ve got the results. To summarize where we’re at:
Your new camera is a USB UVC camera (X002HZMSPH / UB020201), so the OV5647 instructions don’t apply - that’s why nothing you tried earlier worked.
Switching to MJPG is the right move and it’s confirmed on the device, but you’re still seeing 3-4 fps and dropouts even in a raw ffmpeg capture, which rules out VLC/mjpg-streamer as the cause.
The dmesg disconnect/reconnect lines point to a USB bandwidth or power stability issue on the Pi 3b rather than a software/config problem.
Root cause isn’t confirmed yet.
Next steps to close this out: test 720p and a lower 1080p frame rate, grab the exact dmesg lines around the disconnect, and confirm nothing else is sharing the USB bus. Once we have those, we’ll know whether it’s a power issue, a bandwidth ceiling, or something in the camera’s USB descriptor.
For the http port streaming goal, mjpg-streamer (vlc http://:8080/?action=stream) is what we’ll use once the capture is stable - no point running a stream server on top of an unstable capture. Post your results and we’ll continue.