avaf
March 18, 2024, 9:32pm
81
I see.
In the camera case, the src is hs=1080 and dst hs=1080.
The grabbed frame size = 1920 x 1080 * 3 / 2 (AV_PIX_FMT_NV12) and the destination frame size to encode is the same.
I will test a 1920 x 1080 fake buffer and a 1920 x 1088 (AV_PIX_FMT_YUV420P) and see what i get.
Thanks anyway.
avaf
March 18, 2024, 11:16pm
82
The tests confirmed the dst frame buffer that will be encoded must have hs=1088.
the frame size is 1920 x 1088 * 3 / 2 for NV12.
# MPP Development Reference
| Project: | MPP |
| --------- | ----------- |
| Version: | 0.7 |
| Author: | Herman Chen |
| Date: | 10/17/2023 |
| **Revision** | **Date** | **Description** | **Author** |
| ------------ | ---------- | ------------------------------------------------------------ | --------------------------------------- |
| 0.1 | 04/18/2018 | Initial version | Herman Chen |
| 0.2 | 05/07/2018 | Add decoder control command description, encoder part description and demo part description | Herman Chen |
| 0.3 | 05/22/2018 | Fix some clerical errors and explanation errors, rearrange page numbers | Herman Chen <br/>Xiongbin Xie(精英智通) |
| | 07/08/2019 | Translation | Lily Chen |
| 0.4 | 11/28/2018 | 1、Updated the memory layout instructions of the encoder input image.<br/>2、Correct the encoder flowchart error | Herman Chen<br>Vyagoo |
| 0.5 | 06/08/2020 | Update encoder new configuration interface, no longer supports RK3188 | Herman Chen |
| 0.6 | 06/11/2020 | Translation | Lily Chen |
| 0.7 | 10/17/2023 | add markdown document | Xueman Ruan<br>Yandong Lin |
| | | | |
| | | | |
This file has been truncated. show original
According to the MPP docs you seem to need to copy the planes to satisfy the padding requirements.
1 Like
hey anyone using the npu on dietpi? I’m not sure it supports hardware acceleration
i have run LLM inference on cpu and the performance was great but am wondering if i need to change OS to use the npu
avaf
March 19, 2024, 9:09pm
85
I thought RGA would handle this padding, but no.
I converted NV12 (no padding, the frame grabbed from the camera) to RGB24, and that worked fine during encoding.
But i think there is a penalty during encoding, RGB24 will be converted again, right?
avaf
March 20, 2024, 12:45am
86
What’s the equivalent for this command in ffmpeg?
mpi_enc_test -i /dev/video11 -f 0 -w 1920 -h 1080 -o out_1920x1080.h265 -t 16777220 -n 500 -g 6:6 -rc 1 -bps 2000000 -fps 30
I tried this one but got different results:
ffmpeg -f v4l2 -framerate 30 -video_size 1920x1080 -i /dev/video11 -c:v hevc_rkmpp -b:v 2M -rc_mode 1 -g 6 -vframes 500 -y out_1920x1080.mkv
ffmpeg -init_hw_device rkmpp -f v4l2 -framerate 30 -video_size 1920x1080 -i /dev/video11 \
-vf hwupload,scale_rkrga=w=1920:h=1080:format=rgb24 -c:v hevc_rkmpp -b:v 2M -rc_mode 1 -g 6 -vframes 500 -y out_1920x1080.mkv