NXP MCU 技术论坛
直播中

曹利娟

7年用户 900经验值
私信 关注
[问答]

i.mx8mp在没有root的情况下如何使用Gstreamer vpuenc_h264?


我在以没有 root 权限的“普通”用户身份运行包括 vpuenc_h264 的 Gstreamer 管道时遇到问题。对于 root 用户,以下管道运行没有任何问题:

GST_DEBUG=3 gst-launch-1.0 v4l2src device=/dev/video1 ! video/x-raw,width=1920,height=1080,format=YUY2,framerate=30/1 ! imxvideoconvert_g2d ! vpuenc_h264 ! fakesink
如果我运行与普通用户相同的管道,我会收到以下错误消息:

Setting pipeline to PAUSED ...
====== VPUENC: 4.7.0 build on May 20 2022 06:51:21. ======
        wrapper: 3.0.0 (VPUWRAPPER_ARM64_LINUX Build on Jun  2 2022 08:51:59)
        vpulib: 1.1.1
        firmware: 1.1.1.43690
0:00:00.304720500   624 0xaaaabebc3c90 ERROR                default gstallocatorphymem.c:150:base_alloc: Allocate phymem 10485776 failed.

0:00:00.304755125   624 0xaaaabebc3c90 ERROR                default gstvpu.c:90:gst_vpu_allocate_internal_mem: Could not allocate memory using VPU allocator
0:00:00.304808250   624 0xaaaabebc3c90 ERROR                 vpuenc gstvpuenc.c:556:gst_vpu_enc_start: gst_vpu_allocate_internal_mem fail
0:00:00.304836375   624 0xaaaabebc3c90 WARN            videoencoder gstvideoencoder.c:1804:gst_video_encoder_change_state: error: Failed to start encoder
ERROR: from element /GstPipeline:pipeline0/vpuenc_h264:vpuenc_h264-0: Could not initialize supporting library.
Additional debug info:
../git/gst-libs/gst/video/gstvideoencoder.c(1804): gst_video_encoder_change_state (): /GstPipeline:pipeline0/vpuenc_h264:vpuenc_h264-0:
Failed to start encoder
ERROR: pipeline doesn't want to preroll.
Failed to set pipeline to PAUSED.
Setting pipeline to NULL ...
Freeing pipeline ...
我认为用户缺少分配内存的权利。
到目前为止我尝试的是将用户添加到视频和 kmem 组。我也把 /dev/mxc_hantro 和 /dev/mxc_hantro_vc8000e 组改成了视频。但没有任何帮助。
有谁知道问题可能是什么以及运行它需要哪些权利?
提前致谢!
此致,
丹尼尔
PS 我正在使用 Yocto Kirkstone 和内核 5.15.60


更多回帖

发帖
×
20
完善资料,
赚取积分