01-26-2022, 03:39 PM
(01-26-2022, 02:35 PM)mjhammel Wrote: I'll give this a try, just to prove the hw encoding works in general. However the request from my team was to see if v4l2 itself (and specifically not gstreamer) could be used for encoding. Would you happen to know of a reference on how to use v4l2 directly (like on a commane line) to show hw encoding, specifically on mjpeg, on rk3399?
Also: I have a patch for ffmpeg 4.3.1 that adds v4l2_m2m_mjpeg encoder support. I don't know if it works, but it was in the pbp-tools collection back when I worked with the 5.10.17 kernel.
I don't currently know of an easy way to use v4l2 directly via a CLI tool to encode JPEGs, other than GStreamer's gst-launch with v4l2jpegenc - that's what I'd try first for a CLI tool. Of course if you want to use the v4l2 API directly, you can look at what the GStreamer source code is doing and the API documentation. Section 4.5.2 seems to cover the relevant interface for encoding.