Thread 中讨论的其他器件:TDA4VH
工具/软件:
TDA4VH
SDK 11.0 Linux+FreeRTOS
我们使用 gstreamer 插件 v4l2h264enc 对视频流进行编码。 当我们使用以下 GST 流水线容器时、一切正常工作。
[2025-06-13 12:08:11] gst_wrapper: GstCmdString: [2025-06-13 12:08:11] appsrc format=GST_FORMAT_TIME is-live=true do-timestamp=true block=false name=myAppSrc0 ! queue [2025-06-13 12:08:11] ! video/x-raw, width=(int)1536, height=(int)1728, framerate=(fraction)30/1, format=(string)NV12, interlace-mode=(string)progressive, colorimetry=(string)smpte240m [2025-06-13 12:08:11] ! v4l2h264enc [2025-06-13 12:08:11] ! video/x-h264 [2025-06-13 12:08:11] ! h264parse config-interval=-1 [2025-06-13 12:08:11] ! queue ! appsink name=myAppSink0 max-buffers=50 drop=true [2025-06-13 12:08:11] [2025-06-13 12:08:11] GstPipe init status 0!
通过日志、我们可以确认 appsrc 推送的数据使用 DMA-BUF 的存储器、 因此、我们为 v4l2h264enc 添加了 output-IO-mode=5 配置、以降低 CPU 负载。
[2025-06-13 13:40:22] gst_wrapper: GstCmdString: [2025-06-13 13:40:22] appsrc format=GST_FORMAT_TIME is-live=true do-timestamp=true block=false name=myAppSrc0 ! queue [2025-06-13 13:40:22] ! video/x-raw, width=(int)1536, height=(int)1728, framerate=(fraction)30/1, format=(string)NV12, interlace-mode=(string)progressive, colorimetry=(string)smpte240m [2025-06-13 13:40:22] ! v4l2h264enc output-io-mode=dmabuf-import [2025-06-13 13:40:22] ! video/x-h264 [2025-06-13 13:40:22] ! h264parse config-interval=-1 [2025-06-13 13:40:22] ! queue ! appsink name=myAppSink0 max-buffers=50 drop=true [2025-06-13 13:40:22] [2025-06-13 13:40:22] GstPipe init status 0!
但 v4l2h264enc 插件运行时显示错误:
[2025-06-13 14:22:21] tivxTivxkernelpadimageProcess start !!!! [2025-06-13 14:22:21] 0:00:13.155022482 1036 0xffff3c000d70 WARN v4l2bufferpool gstv4l2bufferpool.c:850:gst_v4l2_buffer_pool_start:<v4l2h264enc0:pool0:src> Uncertain or not enough buffers, enabling copy threshold [2025-06-13 14:22:21] 0:00:13.156372645 1036 0xffff3c000d70 ERROR v4l2allocator gstv4l2allocator.c:1147:gst_v4l2_allocator_import_dmabuf:<v4l2h264enc0:pool0:sink:allocator> Got 2 dmabuf but needed 1 [2025-06-13 14:22:21] 0:00:13.156446342 1036 0xffff3c000d70 ERROR v4l2bufferpool gstv4l2bufferpool.c:389:gst_v4l2_buffer_pool_import_dmabuf:<v4l2h264enc0:pool0:sink> failed to import dmabuf [2025-06-13 14:22:21] 0:00:13.156492308 1036 0xffff3c000d70 WARN bufferpool gstbufferpool.c:1246:default_reset_buffer:<v4l2h264enc0:pool0:sink> Buffer 0xffff3800a3f0 without the memory tag has maxsize (0) that is smaller than the configured buffer pool size (3981312). The buffer will be not be reused. This is most likely a bug in this GstBufferPool subclass [2025-06-13 14:22:21] 0:00:13.156748290 1036 0xffff3c000d70 ERROR v4l2bufferpool gstv4l2bufferpool.c:2211:gst_v4l2_buffer_pool_process:<v4l2h264enc0:pool0:sink> failed to prepare data [2025-06-13 14:22:21] 0:00:13.156832573 1036 0xffff3c000d70 WARN v4l2videoenc gstv4l2videoenc.c:901:gst_v4l2_video_enc_handle_frame:<v4l2h264enc0> error: Failed to process frame. [2025-06-13 14:22:21] 0:00:13.156868849 1036 0xffff3c000d70 WARN v4l2videoenc gstv4l2videoenc.c:901:gst_v4l2_video_enc_handle_frame:<v4l2h264enc0> error: Maybe be due to not enough memory or failing driver [2025-06-13 14:22:21] tivxTivxkernelpadimageProcess start !!!!
我们当前的配置是否正确? 如果正确、应如何解决上述问题?





