Closed MapleAura closed 6 months ago
First please test the encoder to make sure there is no runtime or /dev/{dma_heap,dri}
permission issues.
https://github.com/nyanmisaka/ffmpeg-rockchip/wiki/Encoder#test-encoders
The mpp_buf_get
func from MPP segfaults usually means the parameter can be invalid. Such as mpp_buf_size
. Can you trace the hwfc->width
and hwfc->height
to make sure it has valid values?
These values MUST be set by the user. https://ffmpeg.org/doxygen/trunk/structAVCodecContext.html#a0d8f46461754e8abea0847dcbc41b956
- First please test the encoder to make sure there is no runtime or
/dev/{dma_heap,dri}
permission issues. https://github.com/nyanmisaka/ffmpeg-rockchip/wiki/Encoder#test-encoders- The
mpp_buf_get
func from MPP segfaults usually means the parameter can be invalid. Such asmpp_buf_size
. Can you trace thehwfc->width
andhwfc->height
to make sure it has valid values?These values MUST be set by the user. https://ffmpeg.org/doxygen/trunk/structAVCodecContext.html#a0d8f46461754e8abea0847dcbc41b956
I tested it using the first method. gdb --args ffmpeg -f lavfi -i testsrc2=s=1920x1080,format=nv12 -c:v hevc_rkmpp -qp_init 26 -profile:v main -level 4.1 -g:v 100 -vframes 5000 -y /data/tmp.mp4
Stack:
It seems that the error is the same as before. (Stack#2) I've checked the width and height to make sure the values are valid.(1920*1080)
Which Rockchip linux kernel are you using? (5.10 or 6.1-devel)
And which platform? (3588, 356x or older 33xx)
Which Rockchip linux kernel are you using? (5.10 or 6.1-devel)
And which platform? (3588, 356x or older 33xx)
5.10 3588
# DRM allocator
/dev/dri
/dev/dma_heap
/dev/rga
/dev/mpp_service
- Add the following lines into `/etc/udev/rules.d/99-rk-device-permissions.rules` and reboot.
KERNEL=="mpp_service", MODE="0660", GROUP="video" KERNEL=="rga", MODE="0660", GROUP="video" KERNEL=="system-dma32", MODE="0666", GROUP="video" KERNEL=="system-uncached", MODE="0666", GROUP="video" KERNEL=="system-uncached-dma32", MODE="0666", GROUP="video" RUN+="/usr/bin/chmod a+rw /dev/dma_heap"
- Re-build and install the latest MPP from https://github.com/rockchip-linux/mpp and try again.
- Make sure these device files exist.
# DRM allocator /dev/dri # DMA_HEAP allocator /dev/dma_heap # RGA filters /dev/rga # MPP codecs /dev/mpp_service
- Add the following lines into
/etc/udev/rules.d/99-rk-device-permissions.rules
and reboot.KERNEL=="mpp_service", MODE="0660", GROUP="video" KERNEL=="rga", MODE="0660", GROUP="video" KERNEL=="system-dma32", MODE="0666", GROUP="video" KERNEL=="system-uncached", MODE="0666", GROUP="video" KERNEL=="system-uncached-dma32", MODE="0666", GROUP="video" RUN+="/usr/bin/chmod a+rw /dev/dma_heap"
- Re-build and install the latest MPP from https://github.com/rockchip-linux/mpp and try again.
Thank you very much. Followed your last piece of advice and is working now.
ok following that, doing the mpp tests, 1080p h264 hardware encoding etc work, but hevc does not, get this error ;
[hevc_rkmpp @ 0xaaaae3ae2aa0] Failed to init MPP context: -1 [vost#0:0/hevc_rkmpp @ 0xaaaae3ae2700] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height. Error while filtering: Generic error in an external library [out#0/mp4 @ 0xaaaae3ae1330] Nothing was written into output file, because at least one of its streams received no packets.
This work is fantastic. But I'm having a problem when using this library.
Do you know how to fix it?