Looking for H.264 video capture software for Arducam USB camera on Windows and Linux

Hi, is there any software I can use to capture video in H.264? I’d like to capture videos on Windows and Linux.

I’m using an Arducam 1080P Low Light Low Distortion USB Camera Module with Microphone, 2MP CMOS IMX323 Mini UVC USB2.0 Webcam Board with the 3.3ft/1m cable. The listing says it’s for Windows, Linux, Android and Mac OS.

I don’t have any logs or code to share yet, I just want to know what tool I should be using. Thanks.

Hi, thanks for the details. Before anything else, one thing worth checking: is the H.264 requirement about the camera streaming H.264 natively, or do you just need the recorded file to be H.264 encoded on the host side?

That distinction matters a lot for this module, because it’s a UVC camera, so what Windows and Linux see it as is a standard webcam.

For the Windows side we have an H264 Preview tool that many customers use with these UVC modules. Here’s the package: H264 Preview v1.14 - https://cdn.arducam.com/forum/324b059a34caf4f4af17fbd83f1a407c/H264%20Preview%20v1(1).14.rar

Give that a try first and tell me what you see in the preview window, then we can work out the Linux side.

OK I extracted the package and ran it on Windows 10. It does open the camera feed and I can hit record - it produces a .h264 file that plays back fine, so that part is good.

But the same tool doesn’t seem to have a Linux version. On Ubuntu 20.04 the camera does show up as /dev/video0 and I can get a picture, but there’s no H.264 option anywhere. Is there something I’m missing, or is the Linux capture just not supported?

Nothing missing on your side, that tool is Windows only.

Before I point you at the Linux route, let’s confirm what the camera actually exposes on that machine. Can you run these two and paste the output?

  1. v4l2-ctl --list-formats-ext -d /dev/video0
  2. lsusb (just the line for the camera)

That will tell us whether the device is handing over an H.264 stream at all or only raw/YUV + compressed frames.

Here’s what I get:

$ v4l2-ctl --list-formats-ext -d /dev/video0
ioctl: VIDIOC_ENUM_FMT
Type: Video Capture

[0]: 'MJPG' (Motion-JPEG, compressed)
	Size: Discrete 1920x1080
		Interval: Discrete 0.033s (30.000 fps)
	Size: Discrete 1280x720
		Interval: Discrete 0.033s (30.000 fps)
	Size: Discrete 640x480
		Interval: Discrete 0.033s (30.000 fps)

[1]: 'YUYV' (YUYV 4:2:2)
	Size: Discrete 1920x1080
		Interval: Discrete 0.200s (5.000 fps)
	Size: Discrete 640x480
		Interval: Discrete 0.033s (30.000 fps)

And lsusb just lists it as a generic UVC camera on bus 001. No H264 entry anywhere in the format list.

So I’m guessing the H.264 file the Windows tool produced was encoded by the software, not by the camera?

Exactly right, and that’s the key point here.

Your IMX323 module is a UVC device and it only streams MJPG or YUYV over USB2.0. There is no H.264 encoder in the camera and no UVC H.264 payload - the Windows tool pulls in the MJPEG frames and encodes them to H.264 on the CPU. That’s why Windows “just works” and why Linux has nothing comparable: the Linux capture just isn’t a thing for that tool.

On Linux you have to do the same thing yourself. The usual way with this module is to grab the MJPEG stream and feed it to an encoder. For example:

ffmpeg -f v4l2 -input_format mjpeg -video_size 1920x1080 -framerate 30 -i /dev/video0 -c:v libx264 -preset veryfast -pix_fmt yuv420p out.mp4

MJPEG is preferred over YUYV here because YUYV only gives you 5 fps at 1080p anyway.

That works, I get a valid mp4 now, thanks. But performance isn’t great - at 1080p30 libx264 with veryfast I’m at roughly 90-100% of one core and I’m seeing dropped frames and some stutter in the recorded file. What settings would you change?

Also, does H264 Preview on Windows have any settings worth copying over, like bitrate or keyframe interval?

For the CPU side, a few things usually help:

  • Bump the preset: -preset ultrafast drops quality a bit but cuts CPU noticeably, -preset superfast is a decent middle ground.
  • Lower the source frame rate if you don’t need 30: -framerate 15 or 24.
  • Cap resolution to 1280x720 if the pipeline is the bottleneck.
  • If your machine has a GPU, try hardware encoding instead of libx264: -c:v h264_vaapi (Intel/AMD on Linux) or -c:v h264_nvenc (NVIDIA). That takes most of the load off the CPU.
  • Set an explicit keyframe interval to control file size: -g 60 -keyint_min 60 for 30 fps (2s GOP).

On the Windows tool, the bitrate/GOP options are basically the same idea - it’s software encoding under the hood, so there’s no magic setting that makes it faster, it just does the ffmpeg-style work for you with a GUI.

If you paste the actual dropped-frame lines from the ffmpeg output I can tell you whether it’s the encoder or the USB read that’s falling behind.

Tried ultrafast and dropped the resolution to 1280x720 at 30 fps - CPU is much better, around 35-45% of a core, and the stutter is mostly gone. I’ll try h264_vaapi on the other box next, it’s an Intel machine.

One thing that’s still bugging me is latency - the recorded file looks a bit behind, but I assume that’s just the encoder buffering.

Yeah, that’s expected. Software encoding plus the MJPEG decode adds buffering, and the -preset veryfast/ultrafast settings trade latency and quality for speed. If latency matters more than file size, a lower input resolution, faster preset, and a smaller -g value (more frequent keyframes) will tighten it up, at the cost of bitrate.

So to wrap up where this stands for anyone reading:

  • The IMX323 UVC module does not output H.264 itself. Its v4l2 formats are MJPG and YUYV only, so all H.264 video is encoded on the host.
  • Windows: use the H264 Preview tool (package linked earlier). It captures the MJPEG feed and encodes to H.264 on the CPU. No Linux build of that tool exists.
  • Linux: no official GUI equivalent - encode the MJPEG stream yourself with ffmpeg/gstreamer, using libx264 with ultrafast/superfast at 720p, or h264_vaapi/h264_nvenc if you have a supported GPU.
  • Because there’s no hardware H.264 on the camera, there isn’t a way to get a low-CPU, low-latency native H.264 capture on this module - it will always be a host-side encoding job.

If you still see dropped frames after switching to vaapi, post the ffmpeg console output and we can dig into whether it’s the USB read or the encode step that’s limiting you.