HermanChen / mpp

Rockchip MPP(Media Process Platfrom)
172 stars 72 forks source link

Encoding straight from ISP #19

Closed jpiat closed 3 years ago

jpiat commented 4 years ago

Hi,

i have issue getting a good FPS out of a video pipeline that encode video acquired through the ISP. The RAW images are acquired through the v4l2 driver for the ISP and then sent to the MPP encoder. Is there a way to do encoding straight from the ISP without the raw video data ever going to userspace ?

Thanks

PS: why did the mpp repository on linux-rockchip was removed ?

HermanChen commented 4 years ago

The camera source has been added.

The rockchip-linux mpp is temporally set to private for a while. It will be opened later. This repo will release the mpp latest commits.

jpiat commented 4 years ago

I looked at the mpp encoder test with camera input but from what i see its basically using the v4l2 driver for the camera so there is memory copy to user space. Some of the source code of the mpp refers to encoding from isp (with functions left empty), so is there any work in progress to encode straight from ISP ?

HermanChen commented 4 years ago

No, the buffer is using mmap mode and no copy is required.

jpiat commented 4 years ago

how can i evaluate frame-rate using this test ?

jpiat commented 4 years ago

i just did a test using time in inux and the result seems very promising since i encode 3000 frames in 100 seconds which is 30FPS. I'll give it some more test.

jpiat commented 4 years ago

After looking at the code it seems that example maps the v4l2 buffers to dma so that there is no memcpy involved to get transfer the buffers to the mpp. This works very well but unfortunately it means that applications that needs to process the frame (like gstreamer) will not achieve the max frame rate.

HermanChen commented 4 years ago

Application can modify the pixel in dma-buf directly or copy to another dma-buf to do the image processing then give it to encoder.