(01-26-2022, 02:05 PM)sigmaris Wrote:Code:-c:v mjpeg_vaapi
This isn't going to get you hardware acceleration on RK3399, this is telling FFmpeg to use the VA-API to talk to the kernel/hardware, but the Hantro encoder driver in the kernel doesn't support this API, it only supports v4l2.
If there was a v4l2-accelerated MJPEG encoder in FFmpeg it would be called "mjpeg_v4l2m2m", but I don't think such an encoder exists, at least I can't see it in my list of ffmpeg -encoders, and I can't find any mention of such a thing online.
I've only seen GStreamer's v4l2jpegenc mentioned as working with the Hantro JPEG encoder, in this thread. I recommend trying the GStreamer encoder (and, the v4l2 stateless codecs e.g. v4l2slh264dec in Gstreamer 1.18 should work for hw-accelerated decoding on RK3399, too)
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.
Michael J. Hammel
mjhammel@graphics-muse.org
michaelhammel@acm.org
mjhammel@graphics-muse.org
michaelhammel@acm.org