Is there any documentation on VIM3’s HW-accelerated video encoding? I’m on Ubuntu built with Fenix and get the following error when trying to run a simple pipeline:
The API on the kernel side for the encoder is different from what you have on the driver. That’s why the same encoder does not work on A311D. You may not need to update the kernel module for the encoder, but I found that it may work incorrectly sometime. DMA buffer seems to be incoherent…
We are also using gstreamer for our application as well, unfortunately, I don’t have the gstreamer_aml code. For us, we read data from camera and pipe to the encoder then send the encoded image to gstreamer for further use ( streaming/saving to file). In the end, we are happier than just using gstreamer because we can open multiple channels on the cameras, and allows us much greater control (we get main camera, additional information, and a down sampling all from V4L2)
Hey @coudy, I see a gstreamer command in your post. Can you please tell me, that you were using a MIPI-CSI camera from khadas or a USB cam? also from where did you got this command: gst-launch-1.0 videotestsrc ! amlvenc ! fakesink -ve
Is there any docs present for it. I want to use gstreamer for my VIM3+MIPI-CSI khadas camera. Can you help me? I’ll use this gstreamer command with cv2.VideoCapture in python
request re-upload for sources to amlogic hw encoder
[edit] ah well i have encoder.c and it looks 264 only
“gxl_h264_enc”,
“txl_h264_enc_cavlc”,
“ga_h264_enc_cabac”,
sorry. ignore me.
anybody have a solution to real-time H264/265 encoding the vim camera? This thread indicates it’s possible, but nothing documented on how to actually do it. I recently downloaded the Ubuntu image, Linux 4.9, and I couldn’t get it to work.
I have test the vim3 camera os08a10 with hardware encoding rtsp streaming ( gstreamer) OK.
The main problem is the amlogic gst encoder plugin’s bad implementation.
The os08a10 could fetch data by format RGB/YUY2, but the amlvenc encoder just only implemetaion input format = NV12, despite it’s caps with RGB/NV21/BGR. But amlvenc using external library /usr/lib/libvpcodecs.so to do the actually work, so we can hack the libvpcodecs.so to force using one format.
Steps:
Use offical ubuntu focal linux 4.9 v1.0.10-220108 image.
Download the encoder libs GitHub - numbqq/encoder_libs_aml, change file encoder_libs_aml/libencoder/h264/bjunion_enc/libvpcodec.cpp , add line format=3; before line 155:
Which interface used by your camera. If it is USB, the latency maybe very high, and amlvenc does not support mjpeg codec, it will cosume much more CPU.