不要使用显示 gstreamer aarch 64 linux

Do not use display gstreamer aarch 64 linux

我在 google 珊瑚开发板上使用 gstreamer 并在其上执行视频分析。 平台详情为:

Linux bored-horse 4.9.51-imx #1 SMP PREEMPT 5 月 14 日星期二 20:34:37 UTC 2019 aarch64 GNU/Linux

我有以下形式的管道:

GST_DEBUG=*gl*:5 gst-launch-1.0 videotestsrc  ! video/x-raw,width=640,height=480,framerate=15/1 ! queue max-size-buffers=1 leaky=downstream  ! glupload ! queue max-size-buffers=1 leaky=downstream ! glfilterbin filter=glcolorscale  ! video/x-raw,format=RGBA,width=320,height=180 ! videoconvert ! video/x-raw,format=RGB,width=320,height=180 ! appsink name=appsink sync=false emit-signals=true max-buffers=1 drop=true

从终端 运行 时工作正常。但是,当我将管道作为后台 service 执行时,它失败了,因为后台服务无权显示。无论如何,我不想显示 window ,我只想将数据连接到 appsink ,以便我可以对其进行视频分析。

所以任何人都知道如何强制它不使用显示并只将数据转发到 appsink。请帮助

我相信您已经就相同的查询联系过我们,我已经回复了,但这里是服务文件,供其他人参考:

[Unit]
Description=Back service
After=weston.target

[Service]
ExecStart=/home/mendel/service_script.sh
Environment=XDG_RUNTIME_DIR=/run/user/1000

[Install]
WantedBy=multi-user.target

我认为问题在于您需要设置 XDG_RUNTIME_DIR 环境变量。

这对我有用:

mendel@bored-quill:~$ sudo systemctl status back
● back.service - Back service
   Loaded: loaded (/lib/systemd/system/back.service; disabled; vendor preset: enabled)
   Active: active (running) since Thu 2020-03-05 14:48:57 UTC; 6h ago
 Main PID: 13522 (service_script.)
    Tasks: 10 (limit: 797)
   Memory: 19.2M
   CGroup: /system.slice/back.service
           ├─13522 /bin/bash /home/mendel/service_script.sh
           └─13523 gst-launch-1.0 videotestsrc ! video/x-raw,width=640,height=480,framerate=15/1 ! queue max-size-buffers=1 leaky=downstream ! glupload ! queue max-size-buffers=1 leaky=downstream ! glfilterbin f

Mar 05 21:43:02 bored-quill service_script.sh[13522]: 6:54:05.284750061 13523 0xaaaad4400a30 DEBUG             gleglimage gsteglimage.c:431:_drm_direct_fourcc_from_info: Getting DRM fourcc for RGBA
Mar 05 21:43:02 bored-quill service_script.sh[13522]: 6:54:05.284849062 13523 0xaaaad4400a30 DEBUG             gleglimage gsteglimage.c:661:gst_egl_image_from_dmabuf_singleplaner: fourcc AB24 (875708993) n_plane
Mar 05 21:43:02 bored-quill service_script.sh[13522]: 6:54:05.285265825 13523 0xffff900040f0 DEBUG           glbasememory gstglbasememory.c:178:gst_gl_base_memory_init: new GL buffer memory:0xffff8035dcc0 size:1
Mar 05 21:43:02 bored-quill service_script.sh[13522]: 6:54:05.285372385 13523 0xffff900040f0 DEBUG          glbasetexture gstglmemory.c:340:gst_gl_memory_init: new GL texture context:<glcontextegl0> memory:0xfff
Mar 05 21:43:02 bored-quill service_script.sh[13522]: 6:54:05.285269905 13523 0xaaaad442b630 DEBUG      gldownloadelement gstgldownloadelement.c:419:gst_gl_download_element_prepare_output_buffer:<gldownloadeleme
Mar 05 21:43:02 bored-quill service_script.sh[13522]: 6:54:05.286813716 13523 0xffff900040f0 DEBUG                gldebug gstgldebug.c:320:_gst_gl_debug_callback:<glcontextegl0> low: GL debug marker from third p
Mar 05 21:43:02 bored-quill service_script.sh[13522]: 6:54:05.286898196 13523 0xffff900040f0 DEBUG               glfilter gstglfilter.c:981:gst_gl_filter_filter_texture: calling filter_texture with textures in:2
Mar 05 21:43:02 bored-quill service_script.sh[13522]: 6:54:05.287709642 13523 0xaaaad4400a30 DEBUG             gleglimage gsteglimage.c:431:_drm_direct_fourcc_from_info: Getting DRM fourcc for RGBA
Mar 05 21:43:02 bored-quill service_script.sh[13522]: 6:54:05.287806243 13523 0xaaaad4400a30 DEBUG             gleglimage gsteglimage.c:661:gst_egl_image_from_dmabuf_singleplaner: fourcc AB24 (875708993) n_plane
Mar 05 21:43:02 bored-quill service_script.sh[13522]: 6:54:05.288226006 13523 0xffff900040f0 DEBUG           glbasememory gstglbasememory.c:178:gst_gl_base_memory_init: new GL buffer memory:0xffff8035dcc0 size:1