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.
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?
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:
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?
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.