Dmabuf mode for v4l2
Posted: 2024-07-25 11:39
Hi everyone! Another chapter of my pico mini B research. I found part of rockchip mpp software in pico buildroot sdk (luckfox-pico/media/mpp/release_mpp_rv1106_arm-rockchip830-linux-uclibcgnueabihf). According to https://github.com/rockchip-linux/mpp readme file there is no support for rv1103 soc, But there is mpp_info_test and mpi_enc_test binaries that are working at my pico board. Obviously, after testing this binaries to work, i found rockchip mpp library (/oem/usr/lib/librockchip_mpp.so.0) at my board. According to their documentation https://github.com/rockchip-linux/mpp/b ... _MPP_EN.md, hardware encoder does not support space, allocated by CPU, but v4l2-ctl using --stream-mmap option, which means that all the pointers to actual raw image buffers are in user-space, and after calling
function with this pointer my program crashes with this messages: Now im trying to figure out how to configure v4l2 driver in DMABUF mode, and i have problems, such as:
1. Trying to configure it from my own application, according to linux kernel documentation https://docs.kernel.org/userspace-api/m ... tml#dmabuf fails on VIDIOC_EXPBUF system call.
2. v4l2-ctl tool working in dmabuf mode with command:
But after encoding raw file at my pc with ffmpeg with this command:
I have output video like that:
So now i'm pretty confused, if this method possibly can work? Can i use mpp library code at this board? If i can, how can i configure DMABUF mode for capturing? There is so many questions, and absolutely no answers in the internet, so i need help. Maybe someone can share experience in this area, as i am completely newbee in embedded linux and digital video. Thanks in advance!
Code: Select all
encode_put_frame()
function with this pointer my program crashes with this messages: Now im trying to figure out how to configure v4l2 driver in DMABUF mode, and i have problems, such as:
1. Trying to configure it from my own application, according to linux kernel documentation https://docs.kernel.org/userspace-api/m ... tml#dmabuf fails on VIDIOC_EXPBUF system call.
2. v4l2-ctl tool working in dmabuf mode with command:
Code: Select all
v4l2-ctl -E11 --stream-dmabuf --stream-to=out.raw --stream-count=100 --set-fmt-video=width=480,height=320,pixelformat=NV21 --verbose --stream-poll
Code: Select all
ffmpeg -f rawvideo -pixel_format nv21 -framerate 25 -video_size 480x320 -i out.raw out.mp4 -loglevel debug